SlideShare uma empresa Scribd logo
1 de 66
agile software development & services
Los Lenguajes de
Programación y su Impacto
en el Pensamiento
Hernán Wilkinson
Twitter: @HernanWilkinson
Blog: objectmodels.blogspot.com
www.10pines.com
The world “we live” in … ?
The world “we live” in … ?
The world “we live” in … ?
The world “we live” in … ?
Bret Victor - Thinking the unthinkable
Language <-> Thinking
What we can not talk about…
we can not think about
(or it is difficult...)
Do not Insist on English
Aimara: Pasado y Futuro
(nayra) (qhipa)
What is the relationship with
Programming Languages?
(K. Iverson: “Notation as a tool of thought”
1979 ACM Turing Award)
If a programming
language does not
allow me to “TALK”
(write) about certain
things
…
Then I can not THINK
about certain
solutions
Let’s see
Li st <Cust omer > sel ect edCust omer s = new Ar r ayLi st <Cust omer > ( ) ;
f or ( Cust omer cust omer : cust omer s)
i f ( cust omer . nameSt ar sWi t h( “ H” ) )
sel ect edCust omer s. add ( cust omer ) ;
r et ur n sel ect edCust omer s;
Let’s see
Li st <Cust omer > sel ect edCust omer s = new Ar r ayLi st <Cust omer > ( ) ;
f or ( Cust omer cust omer : cust omer s)
i f ( cust omer . nameSt ar sWi t h( “ H” ) )
sel ect edCust omer s. add ( cust omer ) ;
r et ur n sel ect edCust omer s;
Li st <Account > sel ect edAccount s = new Ar r ayLi st <Account > ( ) ;
f or ( Account account : account s)
i f ( account . i sOver dr aw( ) )
sel ect edAccount s. add( account ) ;
r et ur n sel ect edAccount ;
Let’s see
Li st <Cust omer > sel ect edCust omer s = new Ar r ayLi st <Cust omer > ( ) ;
f or ( Cust omer cust omer : cust omer s)
i f ( cust omer . nameSt ar sWi t h( “ H” ) )
sel ect edCust omer s. add ( cust omer ) ;
r et ur n sel ect edCust omer s;
Li st <Account > sel ect edAccount s = new Ar r ayLi st <Account > ( ) ;
f or ( Account account : account s)
i f ( account . i sOver dr aw( ) )
sel ect edAccount s. add( account ) ;
r et ur n sel ect edAccount ;
What is the problem?
We have repeated code!
Li st <Cust omer > sel ect edCust omer s = new Ar r ayLi st <Cust omer > ( ) ;
f or ( Cust omer cust omer : cust omers)
i f ( cust omer. nameSt arsWi t h(“H”) )
sel ect edCust omer s. add ( cust omer ) ;
r et ur n sel ect edCust omer s;
Li st <Account > sel ect edAccount s = new Ar r ayLi st <Account > ( ) ;
f or ( Account account : account s)
i f ( account . i sOverdraw() )
sel ect edAccount s. add( account ) ;
r et ur n sel ect edAccount ;
Code != Text
How do we remove it?
Technique:
1. “Contextualize-Copy” the repeated
code to some “place”
2. Parameterize what changes
3. NAME IT!!!
4. Use it :-)
cl ass Col l ect i on<T> {
publ i c Col l ect i on<T> <<NAME>> ( ?) {
Li st <T> sel ect ed = new Ar r ayLi st <T> ( ) ;
f or ( T anObj ect : t hi s )
i f ( )
sel ect ed. add ( anObj ect ) ;
r et ur n sel ect ed: }
this
Copy the repeated code to some place
Li st <Cust omer > sel ect edCust omer s =
new Ar r ayLi st <Cust omer > ( ) ;
f or ( Cust omer cust omer : cust omers)
i f ( cust omer. nameSt arsWi t h(“H”) )
sel ect edCust omer s. add( cust omer ) ;
r et ur n sel ect edCust omer s;
Li st <Account > sel ect edAccount s = new
Ar r ayLi st <Account > ( ) ;
f or ( Account account : account s)
i f ( account . i sOverdraw() )
sel ect edAccount s. add( account ) ;
r et ur n sel ect edAccount ;
Parameterize what changes
Li st <Cust omer > sel ect edCust omer s = new Ar r ayLi st <Cust omer > ( ) ;
f or ( Cust omer cust omer : cust omer s)
i f ( cust omer. nameSt arsWi t h(“H”) )
sel ect edCust omer s. add ( cust omer ) ;
r et ur n sel ect edCust omer s;
Li st <Account > sel ect edAccount s = new Ar r ayLi st <Account > ( ) ;
f or ( Account account : account s)
i f ( account . i sOverdraw() )
sel ect edAccount s. add( account ) ;
r et ur n sel ect edAccount ;
How do we do it?
An object that represents “code”
cl ass Col l ect i on<T> {
publ i c Col l ect i on<T> <<NAME>> ( Cl osure aCl osure) {
Li st <T> sel ect ed = new Ar r ayLi st <T> ( ) ;
f or ( T anObj ect : t hi s )
i f ( )
sel ect ed. add ( anObj ect ) ;
r et ur n sel ect ed: }
this
Copy the repeated code to some place
Li st <Cust omer > sel ect edCust omer s =
new Ar r ayLi st <Cust omer > ( ) ;
f or ( Cust omer cust omer : cust omers)
i f ( cust omer. nameSt arsWi t h(“H”) )
sel ect edCust omer s. add( cust omer ) ;
r et ur n sel ect edCust omer s;
Li st <Account > sel ect edAccount s = new
Ar r ayLi st <Account > ( ) ;
f or ( Account account : account s)
i f ( account . i sOverdraw() )
sel ect edAccount s. add( account ) ;
r et ur n sel ect edAccount ;
aClosure.execute(anObject)
cl ass Col l ect i on<T> {
publ i c Col l ect i on<T> sel ect ( Cl osure aCl osure) {
Li st <T> sel ect ed = new Ar r ayLi st <T> ( ) ;
f or ( T anObj ect : t hi s )
i f ( )
sel ect ed. add ( anObj ect ) ;
r et ur n sel ect ed: }
self
NAME IT!
Li st <Cust omer > sel ect edCust omer s =
new Ar r ayLi st <Cust omer > ( ) ;
f or ( Cust omer cust omer : cust omers)
i f ( cust omer. nameSt arsWi t h(“H”) )
sel ect edCust omer s. add( cust omer ) ;
r et ur n sel ect edCust omer s;
Li st <Account > sel ect edAccount s = new
Ar r ayLi st <Account > ( ) ;
f or ( Account account : account s)
i f ( account . i sOverdraw() )
sel ect edAccount s. add( account ) ;
r et ur n sel ect edAccount ;
aClosure.execute(anObject)
The most difficult
part because it
means that we
understood the
repeated code
meaning
Li st <Cust omer > sel ect edCust omer s = new Ar r ayLi st <Cust omer > ( ) ;
f or ( Cust omer cust omer : cust omer s)
i f ( cust omer . nameSt ar sWi t h( “ H” ) )
sel ect edCust omer s. add ( cust omer ) ;
r et ur n sel ect edCust omer s;
Li st <Account > sel ect edAccount s = new Ar r ayLi st <Account > ( ) ;
f or ( Account account : account s)
i f ( account . i sOver dr aw( ) )
sel ect edAccount s. add( account ) ;
r et ur n sel ect edAccount ;
cut omer s. sel ect ( cust omer - > cust omer . nameSt ar t sWi t h( “ H” ) )
account s. sel ect ( account - > account . i sOver dr aw( ) )
What did we gain?
1. Few words  Simplicity, Easier to
understand, read, remember, etc.
Less bugs!
2. We created a new “abstraction”:
select (filter in Java 8)
3. … and we removed duplicated
code!!
Now… let’s do some reflection
1. Because we are use to that code (is
the programming language the
problem or us?)
2. Because there is no “concept” to
remove it
Why didn’t we see the
“duplicated code”
Why didn’t we came with a
solution?
1. Because the programming language
does not provide us with a “concept”
to think about a solution!
…and much much
more….
Imagine how your
designs would be if
you could use closures
You can create your own control flow
“sintax”
Further reading: LAMBDA The Ultimate…
Hamming / Closure
If there are certain objects that can not be
created in some languages …
… and given the solutions provided by some
programming languages…
The statement: “There are design solutions
that are unthinkable in some
programming languages”
¿Does it surprise you?
Meta-Conclusion
Object = ¿Data + Code?
Meta-Conclusion
Object = ¿Data + Code?
If you think so, you don´t understand OO yet
Meta-Conclusion
Data is an Object
Code is an Object
An Object is a “superior”
concept that unifies data and
code
What is the problem?
No If!
Now… let’s do some reflection
Why did we not see the
“polymorphic message”?

Because 'if' as a reserved word is a
“primitive construction”, there is
nothing behind it

Therefore it does not make us think in
polymorphism
If as a message
A programming language is
its creator's state of
knowledge
timeToRun
timeToRun
timeToRun
timeToRun
timeToRun
timeToRun
timeToRun
timeToRun
Extending a Language!
How can we add specific
behavior to an object?
Let's see an example
Now… let’s do some reflection
1. What are the solutions
we lack due to limited
meta programming?
2. What do we loose if we
do not have a meta-
circular language?
How do we learn a new word?
Do we:
1. Stop our brain
2. “edit" a new definition in our
dictionary
3. “Compile” the new definition
4. Restart our brain?
NO!!
Why do we have to do it with our
programs?
Can our programs “change while
running”?
Can our programs “learn” as we learn?
Yes, they can!... If they are
METACIRCULAR
Apply
Eval
If we don’t have meta-circular
languages, then we can not think
about solutions that are natural in
our daily lives!!
Let’s think again…
Are these concepts new?
Lisp
John McCarthy
Alan Kay
“We must know our history
if we don’t want to reinvent
… not only the tire, but a
a flat tire”
Conclusions
 Do not accept languages without
Closures
 Do not accept languages without
good meta-programming
 Create your own extensions!
 Liberate yourself from the
programming language and
frameworks
Conclusions
 Learn other programming
languages
Lisp/Scheme
Smalltalk
Forth and more...
 Learn our history
"The Humble Programmer”
E. Dijkstra
“The tools we are trying to use
and the language or notation
we are using to express or
record our thoughts, are the
major factors determining
what we can think or express
at all!"
Questions?
agile software development & services
Muchas gracias!
info@10pines.com
www.10Pines.com
twitter: @10Pines
Argentina
Tel.: +54 (11) 6091-3125
Alem 693, 5B
(1001) Buenos Aires

Mais conteúdo relacionado

Mais procurados

Save time by applying clean code principles
Save time by applying clean code principlesSave time by applying clean code principles
Save time by applying clean code principlesEdorian
 
Refactoring-ch7 moving feature btw objects
Refactoring-ch7 moving feature btw objectsRefactoring-ch7 moving feature btw objects
Refactoring-ch7 moving feature btw objectsfungfung Chen
 
Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009Heiko Behrens
 
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]Chris Adamson
 
Clean Code Principles
Clean Code PrinciplesClean Code Principles
Clean Code PrinciplesYeurDreamin'
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScriptAndres Baravalle
 

Mais procurados (11)

Javascript essentials
Javascript essentialsJavascript essentials
Javascript essentials
 
Save time by applying clean code principles
Save time by applying clean code principlesSave time by applying clean code principles
Save time by applying clean code principles
 
Refactoring-ch7 moving feature btw objects
Refactoring-ch7 moving feature btw objectsRefactoring-ch7 moving feature btw objects
Refactoring-ch7 moving feature btw objects
 
C++ Programming
C++ ProgrammingC++ Programming
C++ Programming
 
Java script
Java scriptJava script
Java script
 
Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009
 
Java script
Java scriptJava script
Java script
 
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
 
Clean Code Principles
Clean Code PrinciplesClean Code Principles
Clean Code Principles
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Oops presentation
Oops presentationOops presentation
Oops presentation
 

Destaque

A new object oriented model of the gregorian calendar
A new object oriented model of the gregorian calendarA new object oriented model of the gregorian calendar
A new object oriented model of the gregorian calendarHernan Wilkinson
 
Growing an open participative horizontal and based on trust company
Growing an open participative horizontal and based on trust companyGrowing an open participative horizontal and based on trust company
Growing an open participative horizontal and based on trust companyHernan Wilkinson
 
Augmenting Smalltalk Syntax
Augmenting Smalltalk SyntaxAugmenting Smalltalk Syntax
Augmenting Smalltalk SyntaxHernan Wilkinson
 
Técnicas y herramientas para que la computadora haga más y el programador m...
Técnicas y herramientas para que la computadora haga más y el programador m...Técnicas y herramientas para que la computadora haga más y el programador m...
Técnicas y herramientas para que la computadora haga más y el programador m...Hernan Wilkinson
 
Como escribir buenos tests al hacer TDD
Como escribir buenos tests al hacer TDDComo escribir buenos tests al hacer TDD
Como escribir buenos tests al hacer TDDHernan Wilkinson
 
Desarrollando sistemas con metodologías y técnicas agiles
Desarrollando sistemas con metodologías y técnicas agilesDesarrollando sistemas con metodologías y técnicas agiles
Desarrollando sistemas con metodologías y técnicas agilesHernan Wilkinson
 
Arithmetic with measures on dynamically typed object oriented languages
Arithmetic with measures on dynamically typed object oriented languagesArithmetic with measures on dynamically typed object oriented languages
Arithmetic with measures on dynamically typed object oriented languagesHernan Wilkinson
 
Objects: The Misunderstood Paradigm
Objects: The Misunderstood ParadigmObjects: The Misunderstood Paradigm
Objects: The Misunderstood ParadigmHernan Wilkinson
 
Confianza+Participación+Transparencia= Refactorizando la empresa
Confianza+Participación+Transparencia= Refactorizando la empresaConfianza+Participación+Transparencia= Refactorizando la empresa
Confianza+Participación+Transparencia= Refactorizando la empresaHernan Wilkinson
 
Como hacer tdd y no morir en el intento
Como hacer tdd y no morir en el intentoComo hacer tdd y no morir en el intento
Como hacer tdd y no morir en el intentoHernan Wilkinson
 
Obejct Oriented SCM - OOSCM
Obejct Oriented SCM - OOSCMObejct Oriented SCM - OOSCM
Obejct Oriented SCM - OOSCMHernan Wilkinson
 
Los diez mandamientos de TDD
Los diez mandamientos de TDDLos diez mandamientos de TDD
Los diez mandamientos de TDDHernan Wilkinson
 
Think Like a Programmer
Think Like a ProgrammerThink Like a Programmer
Think Like a Programmerdaoswald
 
Eliminando la brecha entre clientes y desarrolladores mediante BDD
Eliminando la brecha entre clientes y desarrolladores mediante BDDEliminando la brecha entre clientes y desarrolladores mediante BDD
Eliminando la brecha entre clientes y desarrolladores mediante BDDJorge Gamba
 
Refactoring a Company - 2nd Presentation
Refactoring a Company - 2nd PresentationRefactoring a Company - 2nd Presentation
Refactoring a Company - 2nd PresentationHernan Wilkinson
 
Encadenamiento de refactorings para generar cambios Agiles de Diseño
Encadenamiento de refactorings para generar cambios Agiles de DiseñoEncadenamiento de refactorings para generar cambios Agiles de Diseño
Encadenamiento de refactorings para generar cambios Agiles de DiseñoHernan Wilkinson
 
The ten commandments of TDD
The ten commandments of TDDThe ten commandments of TDD
The ten commandments of TDDHernan Wilkinson
 

Destaque (20)

A new object oriented model of the gregorian calendar
A new object oriented model of the gregorian calendarA new object oriented model of the gregorian calendar
A new object oriented model of the gregorian calendar
 
Growing an open participative horizontal and based on trust company
Growing an open participative horizontal and based on trust companyGrowing an open participative horizontal and based on trust company
Growing an open participative horizontal and based on trust company
 
Augmenting Smalltalk Syntax
Augmenting Smalltalk SyntaxAugmenting Smalltalk Syntax
Augmenting Smalltalk Syntax
 
Técnicas y herramientas para que la computadora haga más y el programador m...
Técnicas y herramientas para que la computadora haga más y el programador m...Técnicas y herramientas para que la computadora haga más y el programador m...
Técnicas y herramientas para que la computadora haga más y el programador m...
 
Como escribir buenos tests al hacer TDD
Como escribir buenos tests al hacer TDDComo escribir buenos tests al hacer TDD
Como escribir buenos tests al hacer TDD
 
Desarrollando sistemas con metodologías y técnicas agiles
Desarrollando sistemas con metodologías y técnicas agilesDesarrollando sistemas con metodologías y técnicas agiles
Desarrollando sistemas con metodologías y técnicas agiles
 
Arithmetic with measures on dynamically typed object oriented languages
Arithmetic with measures on dynamically typed object oriented languagesArithmetic with measures on dynamically typed object oriented languages
Arithmetic with measures on dynamically typed object oriented languages
 
Objects: The Misunderstood Paradigm
Objects: The Misunderstood ParadigmObjects: The Misunderstood Paradigm
Objects: The Misunderstood Paradigm
 
Confianza+Participación+Transparencia= Refactorizando la empresa
Confianza+Participación+Transparencia= Refactorizando la empresaConfianza+Participación+Transparencia= Refactorizando la empresa
Confianza+Participación+Transparencia= Refactorizando la empresa
 
Como hacer tdd y no morir en el intento
Como hacer tdd y no morir en el intentoComo hacer tdd y no morir en el intento
Como hacer tdd y no morir en el intento
 
Obejct Oriented SCM - OOSCM
Obejct Oriented SCM - OOSCMObejct Oriented SCM - OOSCM
Obejct Oriented SCM - OOSCM
 
Los diez mandamientos de TDD
Los diez mandamientos de TDDLos diez mandamientos de TDD
Los diez mandamientos de TDD
 
Things programmers know
Things programmers knowThings programmers know
Things programmers know
 
Think Like a Programmer
Think Like a ProgrammerThink Like a Programmer
Think Like a Programmer
 
Eliminando la brecha entre clientes y desarrolladores mediante BDD
Eliminando la brecha entre clientes y desarrolladores mediante BDDEliminando la brecha entre clientes y desarrolladores mediante BDD
Eliminando la brecha entre clientes y desarrolladores mediante BDD
 
Refactoring a Company - 2nd Presentation
Refactoring a Company - 2nd PresentationRefactoring a Company - 2nd Presentation
Refactoring a Company - 2nd Presentation
 
Tdd on the rocks
Tdd on the rocks Tdd on the rocks
Tdd on the rocks
 
Tdd con Angular y jasmine
Tdd con Angular y jasmineTdd con Angular y jasmine
Tdd con Angular y jasmine
 
Encadenamiento de refactorings para generar cambios Agiles de Diseño
Encadenamiento de refactorings para generar cambios Agiles de DiseñoEncadenamiento de refactorings para generar cambios Agiles de Diseño
Encadenamiento de refactorings para generar cambios Agiles de Diseño
 
The ten commandments of TDD
The ten commandments of TDDThe ten commandments of TDD
The ten commandments of TDD
 

Semelhante a Programming Languages and their influence in Thinking

Types Working for You, Not Against You
Types Working for You, Not Against YouTypes Working for You, Not Against You
Types Working for You, Not Against YouC4Media
 
Cluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CCluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CSteffen Wenz
 
Introduction to C++
Introduction to C++ Introduction to C++
Introduction to C++ Bharat Kalia
 
From clever code to better code
From clever code to better codeFrom clever code to better code
From clever code to better codeDror Helper
 
Functional microscope - Lenses in C++
Functional microscope - Lenses in C++Functional microscope - Lenses in C++
Functional microscope - Lenses in C++Alexander Granin
 
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptSourabhPal46
 
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptMard Geer
 
Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++Platonov Sergey
 
Library functions in c++
Library functions in c++Library functions in c++
Library functions in c++Neeru Mittal
 
Category theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) DataCategory theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) Datagreenwop
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! aleks-f
 
C++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical ReviewerC++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical ReviewerAndrey Karpov
 
Functional Principles for OO Developers
Functional Principles for OO DevelopersFunctional Principles for OO Developers
Functional Principles for OO Developersjessitron
 

Semelhante a Programming Languages and their influence in Thinking (20)

Types Working for You, Not Against You
Types Working for You, Not Against YouTypes Working for You, Not Against You
Types Working for You, Not Against You
 
c_tutorial_2.ppt
c_tutorial_2.pptc_tutorial_2.ppt
c_tutorial_2.ppt
 
Cluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CCluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in C
 
C tutorial
C tutorialC tutorial
C tutorial
 
Introduction to C++
Introduction to C++ Introduction to C++
Introduction to C++
 
From clever code to better code
From clever code to better codeFrom clever code to better code
From clever code to better code
 
C# Today and Tomorrow
C# Today and TomorrowC# Today and Tomorrow
C# Today and Tomorrow
 
Functional microscope - Lenses in C++
Functional microscope - Lenses in C++Functional microscope - Lenses in C++
Functional microscope - Lenses in C++
 
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.ppt
 
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.ppt
 
Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++
 
Library functions in c++
Library functions in c++Library functions in c++
Library functions in c++
 
Category theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) DataCategory theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) Data
 
Mufix Network Programming Lecture
Mufix Network Programming LectureMufix Network Programming Lecture
Mufix Network Programming Lecture
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! 
 
C tutorial
C tutorialC tutorial
C tutorial
 
C tutorial
C tutorialC tutorial
C tutorial
 
C tutorial
C tutorialC tutorial
C tutorial
 
C++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical ReviewerC++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical Reviewer
 
Functional Principles for OO Developers
Functional Principles for OO DevelopersFunctional Principles for OO Developers
Functional Principles for OO Developers
 

Mais de Hernan Wilkinson

Hacia una síntesis de diseño a partir de entender qué es modelar con software
Hacia una síntesis de diseño a partir de entender qué es modelar con softwareHacia una síntesis de diseño a partir de entender qué es modelar con software
Hacia una síntesis de diseño a partir de entender qué es modelar con softwareHernan Wilkinson
 
Live Typing - California Smalltalkers
Live Typing - California SmalltalkersLive Typing - California Smalltalkers
Live Typing - California SmalltalkersHernan Wilkinson
 
Buenos Aires vs. (London vs. Chicago) Agiles 2020
Buenos Aires vs. (London vs. Chicago) Agiles 2020Buenos Aires vs. (London vs. Chicago) Agiles 2020
Buenos Aires vs. (London vs. Chicago) Agiles 2020Hernan Wilkinson
 
LiveTyping - Anotación automática de tipos para lenguajes dinámicos
LiveTyping - Anotación automática de tipos para lenguajes dinámicosLiveTyping - Anotación automática de tipos para lenguajes dinámicos
LiveTyping - Anotación automática de tipos para lenguajes dinámicosHernan Wilkinson
 
LiveTyping: Update and What is next
LiveTyping: Update and What is nextLiveTyping: Update and What is next
LiveTyping: Update and What is nextHernan Wilkinson
 
Cuis smalltalk past present and future
Cuis smalltalk past present and futureCuis smalltalk past present and future
Cuis smalltalk past present and futureHernan Wilkinson
 
Live Typing - Automatic Type Annotation that improves the Programming eXperie...
Live Typing- Automatic Type Annotation that improves the Programming eXperie...Live Typing- Automatic Type Annotation that improves the Programming eXperie...
Live Typing - Automatic Type Annotation that improves the Programming eXperie...Hernan Wilkinson
 
El Desarrollo de Software como debería Ser - PyConAr 2018
El Desarrollo de Software como debería Ser - PyConAr 2018El Desarrollo de Software como debería Ser - PyConAr 2018
El Desarrollo de Software como debería Ser - PyConAr 2018Hernan Wilkinson
 
Lessons Learned Implementing Refactorings
Lessons Learned Implementing RefactoringsLessons Learned Implementing Refactorings
Lessons Learned Implementing RefactoringsHernan Wilkinson
 
El Desarrollo de Software como debería Ser - Nerdear.la 2018
El Desarrollo de Software como debería Ser - Nerdear.la 2018El Desarrollo de Software como debería Ser - Nerdear.la 2018
El Desarrollo de Software como debería Ser - Nerdear.la 2018Hernan Wilkinson
 
El Desarrollo de Software como debería Ser
El Desarrollo de Software como debería SerEl Desarrollo de Software como debería Ser
El Desarrollo de Software como debería SerHernan Wilkinson
 
Go/Ruby/Java: What's next?
Go/Ruby/Java: What's next?Go/Ruby/Java: What's next?
Go/Ruby/Java: What's next?Hernan Wilkinson
 
Exceptions: Why, When, How and Where!
Exceptions: Why, When, How and Where!Exceptions: Why, When, How and Where!
Exceptions: Why, When, How and Where!Hernan Wilkinson
 

Mais de Hernan Wilkinson (17)

Hacia una síntesis de diseño a partir de entender qué es modelar con software
Hacia una síntesis de diseño a partir de entender qué es modelar con softwareHacia una síntesis de diseño a partir de entender qué es modelar con software
Hacia una síntesis de diseño a partir de entender qué es modelar con software
 
Live Typing - California Smalltalkers
Live Typing - California SmalltalkersLive Typing - California Smalltalkers
Live Typing - California Smalltalkers
 
Buenos Aires vs. (London vs. Chicago) Agiles 2020
Buenos Aires vs. (London vs. Chicago) Agiles 2020Buenos Aires vs. (London vs. Chicago) Agiles 2020
Buenos Aires vs. (London vs. Chicago) Agiles 2020
 
LiveTyping - Anotación automática de tipos para lenguajes dinámicos
LiveTyping - Anotación automática de tipos para lenguajes dinámicosLiveTyping - Anotación automática de tipos para lenguajes dinámicos
LiveTyping - Anotación automática de tipos para lenguajes dinámicos
 
LiveTyping: Update and What is next
LiveTyping: Update and What is nextLiveTyping: Update and What is next
LiveTyping: Update and What is next
 
Cuis smalltalk past present and future
Cuis smalltalk past present and futureCuis smalltalk past present and future
Cuis smalltalk past present and future
 
Live Typing - Automatic Type Annotation that improves the Programming eXperie...
Live Typing- Automatic Type Annotation that improves the Programming eXperie...Live Typing- Automatic Type Annotation that improves the Programming eXperie...
Live Typing - Automatic Type Annotation that improves the Programming eXperie...
 
El Desarrollo de Software como debería Ser - PyConAr 2018
El Desarrollo de Software como debería Ser - PyConAr 2018El Desarrollo de Software como debería Ser - PyConAr 2018
El Desarrollo de Software como debería Ser - PyConAr 2018
 
Lessons Learned Implementing Refactorings
Lessons Learned Implementing RefactoringsLessons Learned Implementing Refactorings
Lessons Learned Implementing Refactorings
 
Dynamic Type Information
Dynamic Type InformationDynamic Type Information
Dynamic Type Information
 
El Desarrollo de Software como debería Ser - Nerdear.la 2018
El Desarrollo de Software como debería Ser - Nerdear.la 2018El Desarrollo de Software como debería Ser - Nerdear.la 2018
El Desarrollo de Software como debería Ser - Nerdear.la 2018
 
El Desarrollo de Software como debería Ser
El Desarrollo de Software como debería SerEl Desarrollo de Software como debería Ser
El Desarrollo de Software como debería Ser
 
TDD & Refactoring
TDD & RefactoringTDD & Refactoring
TDD & Refactoring
 
Go/Ruby/Java: What's next?
Go/Ruby/Java: What's next?Go/Ruby/Java: What's next?
Go/Ruby/Java: What's next?
 
Exceptions: Why, When, How and Where!
Exceptions: Why, When, How and Where!Exceptions: Why, When, How and Where!
Exceptions: Why, When, How and Where!
 
CuisUniversity
CuisUniversityCuisUniversity
CuisUniversity
 
Oop is not Dead
Oop is not DeadOop is not Dead
Oop is not Dead
 

Último

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 

Último (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 

Programming Languages and their influence in Thinking

  • 1. agile software development & services Los Lenguajes de Programación y su Impacto en el Pensamiento Hernán Wilkinson Twitter: @HernanWilkinson Blog: objectmodels.blogspot.com www.10pines.com
  • 2. The world “we live” in … ?
  • 3. The world “we live” in … ?
  • 4. The world “we live” in … ?
  • 5. The world “we live” in … ?
  • 6. Bret Victor - Thinking the unthinkable
  • 8. What we can not talk about… we can not think about (or it is difficult...)
  • 9. Do not Insist on English
  • 10. Aimara: Pasado y Futuro (nayra) (qhipa)
  • 11.
  • 12. What is the relationship with Programming Languages? (K. Iverson: “Notation as a tool of thought” 1979 ACM Turing Award)
  • 13. If a programming language does not allow me to “TALK” (write) about certain things … Then I can not THINK about certain solutions
  • 14. Let’s see Li st <Cust omer > sel ect edCust omer s = new Ar r ayLi st <Cust omer > ( ) ; f or ( Cust omer cust omer : cust omer s) i f ( cust omer . nameSt ar sWi t h( “ H” ) ) sel ect edCust omer s. add ( cust omer ) ; r et ur n sel ect edCust omer s;
  • 15. Let’s see Li st <Cust omer > sel ect edCust omer s = new Ar r ayLi st <Cust omer > ( ) ; f or ( Cust omer cust omer : cust omer s) i f ( cust omer . nameSt ar sWi t h( “ H” ) ) sel ect edCust omer s. add ( cust omer ) ; r et ur n sel ect edCust omer s; Li st <Account > sel ect edAccount s = new Ar r ayLi st <Account > ( ) ; f or ( Account account : account s) i f ( account . i sOver dr aw( ) ) sel ect edAccount s. add( account ) ; r et ur n sel ect edAccount ;
  • 16. Let’s see Li st <Cust omer > sel ect edCust omer s = new Ar r ayLi st <Cust omer > ( ) ; f or ( Cust omer cust omer : cust omer s) i f ( cust omer . nameSt ar sWi t h( “ H” ) ) sel ect edCust omer s. add ( cust omer ) ; r et ur n sel ect edCust omer s; Li st <Account > sel ect edAccount s = new Ar r ayLi st <Account > ( ) ; f or ( Account account : account s) i f ( account . i sOver dr aw( ) ) sel ect edAccount s. add( account ) ; r et ur n sel ect edAccount ; What is the problem?
  • 17. We have repeated code! Li st <Cust omer > sel ect edCust omer s = new Ar r ayLi st <Cust omer > ( ) ; f or ( Cust omer cust omer : cust omers) i f ( cust omer. nameSt arsWi t h(“H”) ) sel ect edCust omer s. add ( cust omer ) ; r et ur n sel ect edCust omer s; Li st <Account > sel ect edAccount s = new Ar r ayLi st <Account > ( ) ; f or ( Account account : account s) i f ( account . i sOverdraw() ) sel ect edAccount s. add( account ) ; r et ur n sel ect edAccount ;
  • 19. How do we remove it?
  • 20. Technique: 1. “Contextualize-Copy” the repeated code to some “place” 2. Parameterize what changes 3. NAME IT!!! 4. Use it :-)
  • 21. cl ass Col l ect i on<T> { publ i c Col l ect i on<T> <<NAME>> ( ?) { Li st <T> sel ect ed = new Ar r ayLi st <T> ( ) ; f or ( T anObj ect : t hi s ) i f ( ) sel ect ed. add ( anObj ect ) ; r et ur n sel ect ed: } this Copy the repeated code to some place Li st <Cust omer > sel ect edCust omer s = new Ar r ayLi st <Cust omer > ( ) ; f or ( Cust omer cust omer : cust omers) i f ( cust omer. nameSt arsWi t h(“H”) ) sel ect edCust omer s. add( cust omer ) ; r et ur n sel ect edCust omer s; Li st <Account > sel ect edAccount s = new Ar r ayLi st <Account > ( ) ; f or ( Account account : account s) i f ( account . i sOverdraw() ) sel ect edAccount s. add( account ) ; r et ur n sel ect edAccount ;
  • 22. Parameterize what changes Li st <Cust omer > sel ect edCust omer s = new Ar r ayLi st <Cust omer > ( ) ; f or ( Cust omer cust omer : cust omer s) i f ( cust omer. nameSt arsWi t h(“H”) ) sel ect edCust omer s. add ( cust omer ) ; r et ur n sel ect edCust omer s; Li st <Account > sel ect edAccount s = new Ar r ayLi st <Account > ( ) ; f or ( Account account : account s) i f ( account . i sOverdraw() ) sel ect edAccount s. add( account ) ; r et ur n sel ect edAccount ; How do we do it?
  • 23. An object that represents “code”
  • 24. cl ass Col l ect i on<T> { publ i c Col l ect i on<T> <<NAME>> ( Cl osure aCl osure) { Li st <T> sel ect ed = new Ar r ayLi st <T> ( ) ; f or ( T anObj ect : t hi s ) i f ( ) sel ect ed. add ( anObj ect ) ; r et ur n sel ect ed: } this Copy the repeated code to some place Li st <Cust omer > sel ect edCust omer s = new Ar r ayLi st <Cust omer > ( ) ; f or ( Cust omer cust omer : cust omers) i f ( cust omer. nameSt arsWi t h(“H”) ) sel ect edCust omer s. add( cust omer ) ; r et ur n sel ect edCust omer s; Li st <Account > sel ect edAccount s = new Ar r ayLi st <Account > ( ) ; f or ( Account account : account s) i f ( account . i sOverdraw() ) sel ect edAccount s. add( account ) ; r et ur n sel ect edAccount ; aClosure.execute(anObject)
  • 25. cl ass Col l ect i on<T> { publ i c Col l ect i on<T> sel ect ( Cl osure aCl osure) { Li st <T> sel ect ed = new Ar r ayLi st <T> ( ) ; f or ( T anObj ect : t hi s ) i f ( ) sel ect ed. add ( anObj ect ) ; r et ur n sel ect ed: } self NAME IT! Li st <Cust omer > sel ect edCust omer s = new Ar r ayLi st <Cust omer > ( ) ; f or ( Cust omer cust omer : cust omers) i f ( cust omer. nameSt arsWi t h(“H”) ) sel ect edCust omer s. add( cust omer ) ; r et ur n sel ect edCust omer s; Li st <Account > sel ect edAccount s = new Ar r ayLi st <Account > ( ) ; f or ( Account account : account s) i f ( account . i sOverdraw() ) sel ect edAccount s. add( account ) ; r et ur n sel ect edAccount ; aClosure.execute(anObject) The most difficult part because it means that we understood the repeated code meaning
  • 26. Li st <Cust omer > sel ect edCust omer s = new Ar r ayLi st <Cust omer > ( ) ; f or ( Cust omer cust omer : cust omer s) i f ( cust omer . nameSt ar sWi t h( “ H” ) ) sel ect edCust omer s. add ( cust omer ) ; r et ur n sel ect edCust omer s; Li st <Account > sel ect edAccount s = new Ar r ayLi st <Account > ( ) ; f or ( Account account : account s) i f ( account . i sOver dr aw( ) ) sel ect edAccount s. add( account ) ; r et ur n sel ect edAccount ; cut omer s. sel ect ( cust omer - > cust omer . nameSt ar t sWi t h( “ H” ) ) account s. sel ect ( account - > account . i sOver dr aw( ) )
  • 27. What did we gain? 1. Few words  Simplicity, Easier to understand, read, remember, etc. Less bugs! 2. We created a new “abstraction”: select (filter in Java 8) 3. … and we removed duplicated code!!
  • 28. Now… let’s do some reflection
  • 29. 1. Because we are use to that code (is the programming language the problem or us?) 2. Because there is no “concept” to remove it Why didn’t we see the “duplicated code”
  • 30. Why didn’t we came with a solution? 1. Because the programming language does not provide us with a “concept” to think about a solution!
  • 31. …and much much more…. Imagine how your designs would be if you could use closures You can create your own control flow “sintax” Further reading: LAMBDA The Ultimate…
  • 32. Hamming / Closure If there are certain objects that can not be created in some languages … … and given the solutions provided by some programming languages… The statement: “There are design solutions that are unthinkable in some programming languages” ¿Does it surprise you?
  • 34. Meta-Conclusion Object = ¿Data + Code? If you think so, you don´t understand OO yet
  • 35. Meta-Conclusion Data is an Object Code is an Object An Object is a “superior” concept that unifies data and code
  • 36. What is the problem?
  • 38. Now… let’s do some reflection
  • 39. Why did we not see the “polymorphic message”?  Because 'if' as a reserved word is a “primitive construction”, there is nothing behind it  Therefore it does not make us think in polymorphism
  • 40. If as a message
  • 41.
  • 42. A programming language is its creator's state of knowledge
  • 52. How can we add specific behavior to an object? Let's see an example
  • 53. Now… let’s do some reflection 1. What are the solutions we lack due to limited meta programming? 2. What do we loose if we do not have a meta- circular language?
  • 54. How do we learn a new word?
  • 55. Do we: 1. Stop our brain 2. “edit" a new definition in our dictionary 3. “Compile” the new definition 4. Restart our brain?
  • 56. NO!! Why do we have to do it with our programs?
  • 57. Can our programs “change while running”? Can our programs “learn” as we learn?
  • 58. Yes, they can!... If they are METACIRCULAR Apply Eval
  • 59. If we don’t have meta-circular languages, then we can not think about solutions that are natural in our daily lives!!
  • 60. Let’s think again… Are these concepts new?
  • 61. Lisp John McCarthy Alan Kay “We must know our history if we don’t want to reinvent … not only the tire, but a a flat tire”
  • 62. Conclusions  Do not accept languages without Closures  Do not accept languages without good meta-programming  Create your own extensions!  Liberate yourself from the programming language and frameworks
  • 63. Conclusions  Learn other programming languages Lisp/Scheme Smalltalk Forth and more...  Learn our history
  • 64. "The Humble Programmer” E. Dijkstra “The tools we are trying to use and the language or notation we are using to express or record our thoughts, are the major factors determining what we can think or express at all!"
  • 66. agile software development & services Muchas gracias! info@10pines.com www.10Pines.com twitter: @10Pines Argentina Tel.: +54 (11) 6091-3125 Alem 693, 5B (1001) Buenos Aires