SlideShare a Scribd company logo
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

More Related Content

What's hot

Javascript essentials
Javascript essentialsJavascript essentials
Javascript essentials
Bedis ElAchèche
 
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 objects
fungfung Chen
 
C++ Programming
C++ ProgrammingC++ Programming
Java script
Java scriptJava script
Java script
Jubair Ahmed Junjun
 
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
Heiko Behrens
 
Java script
Java scriptJava script
Java script
Sadeek Mohammed
 
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 Principles
YeurDreamin'
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Andres Baravalle
 
Oops presentation
Oops presentationOops presentation
Oops presentation
sushamaGavarskar1
 

What's hot (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
 

Viewers also liked

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
Hernan 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 company
Hernan Wilkinson
 
Augmenting Smalltalk Syntax
Augmenting Smalltalk SyntaxAugmenting Smalltalk Syntax
Augmenting Smalltalk Syntax
Hernan 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 TDD
Hernan 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 agiles
Hernan 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 languages
Hernan Wilkinson
 
Objects: The Misunderstood Paradigm
Objects: The Misunderstood ParadigmObjects: The Misunderstood Paradigm
Objects: The Misunderstood Paradigm
Hernan 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 empresa
Hernan 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 intento
Hernan Wilkinson
 
Obejct Oriented SCM - OOSCM
Obejct Oriented SCM - OOSCMObejct Oriented SCM - OOSCM
Obejct Oriented SCM - OOSCM
Hernan Wilkinson
 
Los diez mandamientos de TDD
Los diez mandamientos de TDDLos diez mandamientos de TDD
Los diez mandamientos de TDD
Hernan Wilkinson
 
Things programmers know
Things programmers knowThings programmers know
Things programmers know
HARMAN Services
 
Think Like a Programmer
Think Like a ProgrammerThink Like a Programmer
Think Like a Programmer
daoswald
 
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
Jorge Gamba
 
Refactoring a Company - 2nd Presentation
Refactoring a Company - 2nd PresentationRefactoring a Company - 2nd Presentation
Refactoring a Company - 2nd PresentationHernan Wilkinson
 
Tdd on the rocks
Tdd on the rocks Tdd on the rocks
Tdd on the rocks
Hernan Wilkinson
 
Tdd con Angular y jasmine
Tdd con Angular y jasmineTdd con Angular y jasmine
Tdd con Angular y jasmine
Sergio Castillo Yrizales
 
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
Hernan Wilkinson
 
The ten commandments of TDD
The ten commandments of TDDThe ten commandments of TDD
The ten commandments of TDDHernan Wilkinson
 

Viewers also liked (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
 

Similar to 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 You
C4Media
 
c_tutorial_2.ppt
c_tutorial_2.pptc_tutorial_2.ppt
c_tutorial_2.ppt
gitesh_nagar
 
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
Steffen Wenz
 
C tutorial
C tutorialC tutorial
C tutorial
Anurag Sukhija
 
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 code
Dror Helper
 
C# Today and Tomorrow
C# Today and TomorrowC# Today and Tomorrow
C# Today and Tomorrow
Bertrand Le Roy
 
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.ppt
Mard Geer
 
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
SourabhPal46
 
Функциональный микроскоп: линзы в 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) Data
greenwop
 
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 Reviewer
Andrey Karpov
 
Functional Principles for OO Developers
Functional Principles for OO DevelopersFunctional Principles for OO Developers
Functional Principles for OO Developers
jessitron
 

Similar to 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
 

More from 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 software
Hernan Wilkinson
 
Live Typing - California Smalltalkers
Live Typing - California SmalltalkersLive Typing - California Smalltalkers
Live Typing - California Smalltalkers
Hernan 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 2020
Hernan 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ámicos
Hernan Wilkinson
 
LiveTyping: Update and What is next
LiveTyping: Update and What is nextLiveTyping: Update and What is next
LiveTyping: Update and What is next
Hernan Wilkinson
 
Cuis smalltalk past present and future
Cuis smalltalk past present and futureCuis smalltalk past present and future
Cuis smalltalk past present and future
Hernan 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 2018
Hernan Wilkinson
 
Lessons Learned Implementing Refactorings
Lessons Learned Implementing RefactoringsLessons Learned Implementing Refactorings
Lessons Learned Implementing Refactorings
Hernan Wilkinson
 
Dynamic Type Information
Dynamic Type InformationDynamic Type Information
Dynamic Type Information
Hernan 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 2018
Hernan 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 Ser
Hernan Wilkinson
 
TDD & Refactoring
TDD & RefactoringTDD & Refactoring
TDD & Refactoring
Hernan 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
 
CuisUniversity
CuisUniversityCuisUniversity
CuisUniversity
Hernan Wilkinson
 
Oop is not Dead
Oop is not DeadOop is not Dead
Oop is not Dead
Hernan Wilkinson
 

More from 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
 

Recently uploaded

Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 

Recently uploaded (20)

Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 

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