SlideShare ist ein Scribd-Unternehmen logo
1 von 92
The Technical Debt of the 
Programming Languages 
… 
and the influence in our thinking 
and designs 
Hernán Wilkinson 
Medellin 2014 
agile software development & services
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 implies Thinking
Language implies Thinking 
Thinking implies Language
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)
Languages without a concept for the 
future — "It rain tomorrow," instead 
of "It will rain tomorrow" — correlate 
strongly with high savings rates.
Now, a design problem 
Let’s think about this: 
How do we call the whole thing?
Let’s say Traffic Light (Semáforo) 
How do we call each part?
Let’s say Traffic Regulator 
(guess why not 'Traffic 
Controller'?) 
How do we call each Traffic Regulator in 
the Traffic Light context?
aTrafficLight 
northSouthRegulator 
eastWestRegulator
aTrafficLight 
rightRegulator 
leftRegulator
aTrafficLight 
regulator1 
regulator2
Not easy way to name them… 
Relative vs. Fix Coordinate System 
B. Lee Whorf 
(Linguistic Relativity)
What is the relationship with 
Programming Languages? 
(K. Iverson: “Notation as a tool of thought”)
If a programming 
language does not 
allow me to “TALK” 
(write) about certain 
things 
… 
Then I can not THINK 
about certain 
solutions
ABSTRACTION
How do we refer to that “thing that has 
four wheels and moves?”
and to “that thing that moves and has 
four wheels?”
and to “that one that 
moves because it has 
four wheels?”
To avoid REPETITION 
To provide MEANING to that 
REPETITION
Meta Note: I repeated the 
picture… I’m lacking an 
abstraction or a better 
image!  
If we have repetition we are lacking 
and abstraction… (an object in OO)
Let’s see 
List<Customer> selectedCustomers = new ArrayList<Customer> (); 
for (Customer customer: customers) 
if (customer.nameStarsWith(“H”)) 
selectedCustomers.add (customer); 
return selectedCustomers; 
List<Account> selectedAccounts = new ArrayList<Account> (); 
for (Account account: accounts) 
if (account.isOverdraw()) 
selectedAccounts.add(account); 
return selectedAccount; 
What is the problem?
We have repeated code! 
List<Customer> selectedCustomers = new ArrayList<Customer> (); 
for (Customer customer: customers) 
if (customer.nameStarsWith(“H”) ) 
selectedCustomers.add (customer); 
return selectedCustomers; 
List<Account> selectedAccounts = new ArrayList<Account> (); 
for (Account account: accounts) 
if (account.isOverdraw() ) 
selectedAccounts.add(account); 
return selectedAccount;
“Repeated code” does not mean 
“repeated text”. 
It means “repeated patterns of 
collaboration”
What is the problem?
We are lacking an 
ABSTRACTION! 
Repeated code means we are 
forgetting an object!
How do we remove it?
Technique: 
1. Copy the repeated code to some 
“place” 
2. Parameterize what changes 
3. NAME IT!!! 
4. Use it :-)
Copy the repeated code to some place 
List<Customer> selectedCustomers = 
new ArrayList<Customer> (); 
for (Customer customer: customers) 
if 
(customer.nameStarsWith(“H”) ) 
selectedCustomers.add(customer); 
return selectedCustomers; 
List<Account> selectedAccounts = new 
ArrayList<Account> (); 
for (Account account: accounts) 
if (account.isOverdraw() ) 
selectedAccounts.add(account); 
return selectedAccount; 
class Collection<T> { 
public Collection<T> <<NAME>> { 
List<T> selected = new ArrayList<T> (); 
for (T anObject: this ) 
if ( ) 
selected.add (anObject); 
return selected: }
Parameterize what changes 
List<Customer> selectedCustomers = new ArrayList<Customer> (); 
for (Customer customer: customers) 
if (customer.nameStarsWith(“H”) ) 
selectedCustomers.add (customer); 
return selectedCustomers; 
List<Account> selectedAccounts = new ArrayList<Account> (); 
for (Account account: accounts) 
if (account.isOverdraw() ) 
selectedAccounts.add(account); 
return selectedAccount; 
How do we do it?
We need an abstraction to represent 
“code” 
We need a BLOCK or a CLOSURE… 
… an object that represents “code”
Parameterize what changes 
List<Customer> selectedCustomers = 
new ArrayList<Customer> (); 
for (Customer customer: customers) 
if 
(customer.nameStarsWith(“H”) ) 
selectedCustomers.add(customer); 
return selectedCustomers; 
class Collection<T> { 
public Collection<T> <<NAME>> (Closure aClosure) { 
List<T> selected = new ArrayList<T> (); 
for (T anObject: this) 
if (aClosure.value(anObject) ) 
selected.add (anObject); 
return selected:} 
List<Account> selectedAccounts = new 
ArrayList<Account> (); 
for (Account account: accounts) 
if (account.isOverdraw() ) 
selectedAccounts.add(account); 
return selectedAccount;
NAME IT!! 
class Collection<T> { 
public Collection<T> select (Closure aClosure) { 
List<T> selected = new ArrayList<T> (); 
for (T anObject: this) 
if (aClosure.value(anObject) ) 
selected.add (anObject); 
return selected:} 
The most difficult 
part because it 
means that we 
understood the 
repeated code 
meaning 
List<Customer> selectedCustomers = 
new ArrayList<Customer> (); 
for (Customer customer: customers) 
if 
(customer.nameStarsWith(“H”) ) 
selectedCustomers.add(customer); 
return selectedCustomers; 
List<Account> selectedAccounts = new 
ArrayList<Account> (); 
for (Account account: accounts) 
if (account.isOverdraw() ) 
selectedAccounts.add(account); 
return selectedAccount;
List<Customer> selectedCustomers = new ArrayList<Customer> (); 
for (Customer customer: customers) 
if (customer.nameStarsWith(“H”)) 
selectedCustomers.add (customer); 
return selectedCustomers; 
cutomers.select( customer => customer.nameStartsWith(“H”) ) 
accounts.select( account => account.isOverdraw() ) 
List<Account> selectedAccounts = new ArrayList<Account> (); 
for (Account account: accounts) 
if (account.isOverdraw()) 
selectedAccounts.add(account); 
return selectedAccount;
Why not an Anonymous Class? 
1. Sintax: 
cutomers.select( customer => customber.nameStartsWith(“H”) ) 
customers.select( new SelectClosure<Customer> () { 
public boolean value (Customer aCustomer) { 
return aCustomer.nameStartsWith(“H”); }}); 
Which one reads better? 
2. Binding problems…
What did we gain? 
1. Few words  Simplicity, Easier to 
understand, read, remember, etc. 
Less bugs! 
2. We created a new “abstraction”: 
select 
3. … and we remove duplicated 
code!!
Now… let’s do some reflection 
1. Why didn’t we see the 
“duplicated code”? 
2. Why didn’t we came 
with a solution?
Why didn’t we see the “duplicated 
code” 
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” 
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 came with a solution? 
1. Because the programming language 
does not provide us with a 
“concept” to think about a solution! 
DOES NOT REALLY?
reject 
List<Customer> selectedCustomers = new ArrayList<Customer> (); 
for (Customer customer: customers) 
if (!customer.nameStarsWith(“H”)) 
selectedCustomers.add (customer); 
return selectedCustomers; 
cutomers reject: [ :aCustomer | aCustomer nameStartsWith: ‘H’ ] (Smalltalk) 
customers.reject { | aCustomer | aCustomer.nameStartsWith(“H”) } (Ruby) 
customers.Where( aCustomer => !aCustomer.nameStarsWith(“H”)) (C#)
detect 
List<Customer> selectedCustomers = new ArrayList<Customer> (); 
for (Customer customer: customers) 
if (customer.nameStarsWith(“H”)) 
return customer; 
throw …. 
customers detect: [ :aCustomer | aCustomer nameStartsWith: ‘H’ ](Smalltalk) 
customers.detect { | aCustomer | aCustomer.nameStartsWith(“H”) } (Ruby) 
customers.First ( aCustomer => aCustomer.nameStarstWith(“H”)) (C#)
collect 
List<String> customerNames = new ArrayList<String> (); 
for (Customer customer: customers) 
customerNames.add (customer.name()); 
return customerNames; 
customers collect: [ :aCustomer | aCustomer name ] (Smalltalk) 
customers.collect { | aCustomer | aCustomer.name () } (Ruby) 
customers.Select( aCustomer => aCustomer.name() ) (C#)
Try { 
… do something 
fail() 
} catch (Exception e) { 
assertTrue (…. ) } 
self 
TDD: Test for exceptions 
should: [ do something ] 
raise: Exception 
withExceptionDo: [ :e | self assert: …. ] (Smallalk)
…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…
Meta-Conclusion 
Object = ¿Data + Code?
Meta-Conclusion 
Object = ¿Data + Code? 
If you think so, you don´t understand OO yet
Mete-Conclusion 
Data is an Object 
Code is an Object 
An Object is a “superior” 
concept that unifies data and 
code
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?
What is the problem?
No If!
If Implementation 
“if” as a reserved word 
– What do we gain? 
– What do we loose? 
“if” as a message 
– What do we gain? 
– What do we loose?
Boole’s Algebra 
“if” as a message
Now… let’s do some reflection 
1. Why didn’t we see the 
“polymorphic message”? 
2. Why didn’t we came 
with a right solution?
Why didn’t we see the 
“polymorphic message” 
 Because 'if' as a reserved word does 
not make us think in polymorphism
How do we model 'age'?
How do we model 'Weight'?
How do we model 'money'? 
How do we model 'length'? 
How do we model 'speed'?
We need algebraic expressions 
Let's see an example
Now… let’s do some reflection 
1. Why don't we use 
algebraic expressions? 
2. How does affect our 
design not to use them?
 Because 'common programming 
languages' only provide arithmetic 
models 
 Because we don't realize that a 
language is the beginning not the 
end.
A programming language is its 
creator's state of knowledge
How does impact our design a 
language without extensible 
classes? 
ArrayHelper?? xxxManager??
How does impact our design a 
language where we can not 
see how it is implemented?
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
Let’s see a problem: 
Can you make a proxy “learn” about its 
proxee as it is used?
If we don’t have meta-circular 
languages, then we can not think 
about solutions where meta-programming 
would fit!
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”
Even More! 
 Static vs. Dynamic typing 
languages? 
Design? 
TDD? 
 Frameworks? 
 Relational Databases? 
 Web applications?
Technical Deb Metaphor… 
Fuente: http://c2.com/cgi/wiki?WardExplainsDebtMetaphor
Why not having closures generate 
debt? 
 Repeated code 
 Lack of abstractions 
 Difficult and costly to maintain
Why not having meta-programming 
generate debt? 
 Some problems are more difficult 
to solve  More code! 
 Programs can not reason about 
programs or themselves 
 We always need a programmer 
to do something a program could 
do
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
Conclusions 
 Learn other programming 
languages 
 Lisp/Scheme 
Smalltalk 
 Forth and more... 
 Learn our history
We teach this and other important 
design aspects in our courses 
• OO Design I & OO Design II 
• TDD & Advanced TDD 
Check them out at: 
http://www.10pines.com/
Questions?
Muchas gracias! 
agile software development & services 
info@10pines.com 
www.10Pines.com 
twitter: @10Pines 
Argentina 
Tel.: +54 (11) 6091-3125 
Alem 693, 5B 
(1001) Buenos Aires

Weitere ähnliche Inhalte

Was ist angesagt?

Refactoring-ch7 moving feature btw objects
Refactoring-ch7 moving feature btw objectsRefactoring-ch7 moving feature btw objects
Refactoring-ch7 moving feature btw objectsfungfung Chen
 
SeneJug java_8_prez_122015
SeneJug java_8_prez_122015SeneJug java_8_prez_122015
SeneJug java_8_prez_122015senejug
 
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
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side JavascriptJulie Iskander
 
PHP for HTML Gurus - J and Beyond 2012
PHP for HTML Gurus - J and Beyond 2012PHP for HTML Gurus - J and Beyond 2012
PHP for HTML Gurus - J and Beyond 2012Andrea Tarr
 

Was ist angesagt? (8)

Refactoring-ch7 moving feature btw objects
Refactoring-ch7 moving feature btw objectsRefactoring-ch7 moving feature btw objects
Refactoring-ch7 moving feature btw objects
 
Java script
Java scriptJava script
Java script
 
SeneJug java_8_prez_122015
SeneJug java_8_prez_122015SeneJug java_8_prez_122015
SeneJug java_8_prez_122015
 
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
 
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]
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side Javascript
 
PHP for HTML Gurus - J and Beyond 2012
PHP for HTML Gurus - J and Beyond 2012PHP for HTML Gurus - J and Beyond 2012
PHP for HTML Gurus - J and Beyond 2012
 
C++ Programming
C++ ProgrammingC++ Programming
C++ Programming
 

Andere mochten auch

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
 
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
 
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
 
Think Like a Programmer
Think Like a ProgrammerThink Like a Programmer
Think Like a Programmerdaoswald
 
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
 
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
 
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
 
The ten commandments of TDD
The ten commandments of TDDThe ten commandments of TDD
The ten commandments of TDDHernan 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
 
Facilitadores asombrosos: logrando mejores conversaciones e interacciones
Facilitadores asombrosos: logrando mejores conversaciones e interaccionesFacilitadores asombrosos: logrando mejores conversaciones e interacciones
Facilitadores asombrosos: logrando mejores conversaciones e interaccionesJuliana Betancur
 

Andere mochten auch (20)

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
 
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
 
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
 
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
 
Refactoring a Company - 2nd Presentation
Refactoring a Company - 2nd PresentationRefactoring a Company - 2nd Presentation
Refactoring a Company - 2nd Presentation
 
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
 
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
 
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
 
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
 
The ten commandments of TDD
The ten commandments of TDDThe ten commandments of TDD
The ten commandments of TDD
 
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
 
Facilitadores asombrosos: logrando mejores conversaciones e interacciones
Facilitadores asombrosos: logrando mejores conversaciones e interaccionesFacilitadores asombrosos: logrando mejores conversaciones e interacciones
Facilitadores asombrosos: logrando mejores conversaciones e interacciones
 
Metaprogramacion
MetaprogramacionMetaprogramacion
Metaprogramacion
 

Ähnlich wie Programming Language Technical debt and their influence in Thinking and Desgin

A Unified View of Modeling and Programming
A Unified View of Modeling and ProgrammingA Unified View of Modeling and Programming
A Unified View of Modeling and ProgrammingEd Seidewitz
 
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
 
Functional microscope - Lenses in C++
Functional microscope - Lenses in C++Functional microscope - Lenses in C++
Functional microscope - Lenses in C++Alexander Granin
 
Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++Platonov Sergey
 
Monads in python
Monads in pythonMonads in python
Monads in pythoneldariof
 
Experiments in Reasoning
Experiments in ReasoningExperiments in Reasoning
Experiments in ReasoningAslam Khan
 
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
 
Functional Principles for OO Developers
Functional Principles for OO DevelopersFunctional Principles for OO Developers
Functional Principles for OO Developersjessitron
 
Tienda Development Workshop - JAB11
Tienda Development Workshop - JAB11Tienda Development Workshop - JAB11
Tienda Development Workshop - JAB11Daniele Rosario
 
Management Consultant Toolkit in powerpoint & Excel
Management Consultant Toolkit in powerpoint & ExcelManagement Consultant Toolkit in powerpoint & Excel
Management Consultant Toolkit in powerpoint & ExcelAurelien Domont, MBA
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right wayThibaud Desodt
 
Connect() Mini 2016
Connect() Mini 2016Connect() Mini 2016
Connect() Mini 2016Jeff Chu
 
Data centric Metaprogramming by Vlad Ulreche
Data centric Metaprogramming by Vlad UlrecheData centric Metaprogramming by Vlad Ulreche
Data centric Metaprogramming by Vlad UlrecheSpark Summit
 
Data Centric Metaprocessing by Vlad Ulreche
Data Centric Metaprocessing by Vlad UlrecheData Centric Metaprocessing by Vlad Ulreche
Data Centric Metaprocessing by Vlad UlrecheSpark Summit
 

Ähnlich wie Programming Language Technical debt and their influence in Thinking and Desgin (20)

A Unified View of Modeling and Programming
A Unified View of Modeling and ProgrammingA Unified View of Modeling and Programming
A Unified View of Modeling and Programming
 
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
 
Functional DDD
Functional DDDFunctional DDD
Functional DDD
 
Functional microscope - Lenses in C++
Functional microscope - Lenses in C++Functional microscope - Lenses in C++
Functional microscope - Lenses in C++
 
Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++
 
Monads in python
Monads in pythonMonads in python
Monads in python
 
Experiments in Reasoning
Experiments in ReasoningExperiments in Reasoning
Experiments in Reasoning
 
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
 
Sql server building a database ppt 12
Sql server building a database ppt 12Sql server building a database ppt 12
Sql server building a database ppt 12
 
Functional Principles for OO Developers
Functional Principles for OO DevelopersFunctional Principles for OO Developers
Functional Principles for OO Developers
 
Tienda Development Workshop - JAB11
Tienda Development Workshop - JAB11Tienda Development Workshop - JAB11
Tienda Development Workshop - JAB11
 
Management Consultant Toolkit in powerpoint & Excel
Management Consultant Toolkit in powerpoint & ExcelManagement Consultant Toolkit in powerpoint & Excel
Management Consultant Toolkit in powerpoint & Excel
 
Deck 6-456 (1)
Deck 6-456 (1)Deck 6-456 (1)
Deck 6-456 (1)
 
Hope driven development
Hope driven developmentHope driven development
Hope driven development
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
 
Connect() Mini 2016
Connect() Mini 2016Connect() Mini 2016
Connect() Mini 2016
 
Encores
EncoresEncores
Encores
 
Data centric Metaprogramming by Vlad Ulreche
Data centric Metaprogramming by Vlad UlrecheData centric Metaprogramming by Vlad Ulreche
Data centric Metaprogramming by Vlad Ulreche
 
Data Centric Metaprocessing by Vlad Ulreche
Data Centric Metaprocessing by Vlad UlrecheData Centric Metaprocessing by Vlad Ulreche
Data Centric Metaprocessing by Vlad Ulreche
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 

Kürzlich hochgeladen (20)

Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 

Programming Language Technical debt and their influence in Thinking and Desgin

  • 1. The Technical Debt of the Programming Languages … and the influence in our thinking and designs Hernán Wilkinson Medellin 2014 agile software development & services
  • 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. Language implies Thinking Thinking implies Language
  • 9. What we can not talk about… we can not think about (or it is difficult...)
  • 10. Do not Insist on English
  • 11. Aimara: Pasado y Futuro (nayra) (qhipa)
  • 12. Languages without a concept for the future — "It rain tomorrow," instead of "It will rain tomorrow" — correlate strongly with high savings rates.
  • 13. Now, a design problem Let’s think about this: How do we call the whole thing?
  • 14. Let’s say Traffic Light (Semáforo) How do we call each part?
  • 15. Let’s say Traffic Regulator (guess why not 'Traffic Controller'?) How do we call each Traffic Regulator in the Traffic Light context?
  • 19. Not easy way to name them… Relative vs. Fix Coordinate System B. Lee Whorf (Linguistic Relativity)
  • 20. What is the relationship with Programming Languages? (K. Iverson: “Notation as a tool of thought”)
  • 21. If a programming language does not allow me to “TALK” (write) about certain things … Then I can not THINK about certain solutions
  • 23. How do we refer to that “thing that has four wheels and moves?”
  • 24. and to “that thing that moves and has four wheels?”
  • 25. and to “that one that moves because it has four wheels?”
  • 26. To avoid REPETITION To provide MEANING to that REPETITION
  • 27. Meta Note: I repeated the picture… I’m lacking an abstraction or a better image!  If we have repetition we are lacking and abstraction… (an object in OO)
  • 28. Let’s see List<Customer> selectedCustomers = new ArrayList<Customer> (); for (Customer customer: customers) if (customer.nameStarsWith(“H”)) selectedCustomers.add (customer); return selectedCustomers; List<Account> selectedAccounts = new ArrayList<Account> (); for (Account account: accounts) if (account.isOverdraw()) selectedAccounts.add(account); return selectedAccount; What is the problem?
  • 29. We have repeated code! List<Customer> selectedCustomers = new ArrayList<Customer> (); for (Customer customer: customers) if (customer.nameStarsWith(“H”) ) selectedCustomers.add (customer); return selectedCustomers; List<Account> selectedAccounts = new ArrayList<Account> (); for (Account account: accounts) if (account.isOverdraw() ) selectedAccounts.add(account); return selectedAccount;
  • 30. “Repeated code” does not mean “repeated text”. It means “repeated patterns of collaboration”
  • 31. What is the problem?
  • 32. We are lacking an ABSTRACTION! Repeated code means we are forgetting an object!
  • 33. How do we remove it?
  • 34. Technique: 1. Copy the repeated code to some “place” 2. Parameterize what changes 3. NAME IT!!! 4. Use it :-)
  • 35. Copy the repeated code to some place List<Customer> selectedCustomers = new ArrayList<Customer> (); for (Customer customer: customers) if (customer.nameStarsWith(“H”) ) selectedCustomers.add(customer); return selectedCustomers; List<Account> selectedAccounts = new ArrayList<Account> (); for (Account account: accounts) if (account.isOverdraw() ) selectedAccounts.add(account); return selectedAccount; class Collection<T> { public Collection<T> <<NAME>> { List<T> selected = new ArrayList<T> (); for (T anObject: this ) if ( ) selected.add (anObject); return selected: }
  • 36. Parameterize what changes List<Customer> selectedCustomers = new ArrayList<Customer> (); for (Customer customer: customers) if (customer.nameStarsWith(“H”) ) selectedCustomers.add (customer); return selectedCustomers; List<Account> selectedAccounts = new ArrayList<Account> (); for (Account account: accounts) if (account.isOverdraw() ) selectedAccounts.add(account); return selectedAccount; How do we do it?
  • 37. We need an abstraction to represent “code” We need a BLOCK or a CLOSURE… … an object that represents “code”
  • 38. Parameterize what changes List<Customer> selectedCustomers = new ArrayList<Customer> (); for (Customer customer: customers) if (customer.nameStarsWith(“H”) ) selectedCustomers.add(customer); return selectedCustomers; class Collection<T> { public Collection<T> <<NAME>> (Closure aClosure) { List<T> selected = new ArrayList<T> (); for (T anObject: this) if (aClosure.value(anObject) ) selected.add (anObject); return selected:} List<Account> selectedAccounts = new ArrayList<Account> (); for (Account account: accounts) if (account.isOverdraw() ) selectedAccounts.add(account); return selectedAccount;
  • 39. NAME IT!! class Collection<T> { public Collection<T> select (Closure aClosure) { List<T> selected = new ArrayList<T> (); for (T anObject: this) if (aClosure.value(anObject) ) selected.add (anObject); return selected:} The most difficult part because it means that we understood the repeated code meaning List<Customer> selectedCustomers = new ArrayList<Customer> (); for (Customer customer: customers) if (customer.nameStarsWith(“H”) ) selectedCustomers.add(customer); return selectedCustomers; List<Account> selectedAccounts = new ArrayList<Account> (); for (Account account: accounts) if (account.isOverdraw() ) selectedAccounts.add(account); return selectedAccount;
  • 40. List<Customer> selectedCustomers = new ArrayList<Customer> (); for (Customer customer: customers) if (customer.nameStarsWith(“H”)) selectedCustomers.add (customer); return selectedCustomers; cutomers.select( customer => customer.nameStartsWith(“H”) ) accounts.select( account => account.isOverdraw() ) List<Account> selectedAccounts = new ArrayList<Account> (); for (Account account: accounts) if (account.isOverdraw()) selectedAccounts.add(account); return selectedAccount;
  • 41. Why not an Anonymous Class? 1. Sintax: cutomers.select( customer => customber.nameStartsWith(“H”) ) customers.select( new SelectClosure<Customer> () { public boolean value (Customer aCustomer) { return aCustomer.nameStartsWith(“H”); }}); Which one reads better? 2. Binding problems…
  • 42. What did we gain? 1. Few words  Simplicity, Easier to understand, read, remember, etc. Less bugs! 2. We created a new “abstraction”: select 3. … and we remove duplicated code!!
  • 43. Now… let’s do some reflection 1. Why didn’t we see the “duplicated code”? 2. Why didn’t we came with a solution?
  • 44. Why didn’t we see the “duplicated code” 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
  • 45. Why didn’t we see the “duplicated code” 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
  • 46. 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! DOES NOT REALLY?
  • 47. reject List<Customer> selectedCustomers = new ArrayList<Customer> (); for (Customer customer: customers) if (!customer.nameStarsWith(“H”)) selectedCustomers.add (customer); return selectedCustomers; cutomers reject: [ :aCustomer | aCustomer nameStartsWith: ‘H’ ] (Smalltalk) customers.reject { | aCustomer | aCustomer.nameStartsWith(“H”) } (Ruby) customers.Where( aCustomer => !aCustomer.nameStarsWith(“H”)) (C#)
  • 48. detect List<Customer> selectedCustomers = new ArrayList<Customer> (); for (Customer customer: customers) if (customer.nameStarsWith(“H”)) return customer; throw …. customers detect: [ :aCustomer | aCustomer nameStartsWith: ‘H’ ](Smalltalk) customers.detect { | aCustomer | aCustomer.nameStartsWith(“H”) } (Ruby) customers.First ( aCustomer => aCustomer.nameStarstWith(“H”)) (C#)
  • 49. collect List<String> customerNames = new ArrayList<String> (); for (Customer customer: customers) customerNames.add (customer.name()); return customerNames; customers collect: [ :aCustomer | aCustomer name ] (Smalltalk) customers.collect { | aCustomer | aCustomer.name () } (Ruby) customers.Select( aCustomer => aCustomer.name() ) (C#)
  • 50. Try { … do something fail() } catch (Exception e) { assertTrue (…. ) } self TDD: Test for exceptions should: [ do something ] raise: Exception withExceptionDo: [ :e | self assert: …. ] (Smallalk)
  • 51. …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…
  • 52. Meta-Conclusion Object = ¿Data + Code?
  • 53. Meta-Conclusion Object = ¿Data + Code? If you think so, you don´t understand OO yet
  • 54. Mete-Conclusion Data is an Object Code is an Object An Object is a “superior” concept that unifies data and code
  • 55. 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?
  • 56. What is the problem?
  • 58. If Implementation “if” as a reserved word – What do we gain? – What do we loose? “if” as a message – What do we gain? – What do we loose?
  • 60. Now… let’s do some reflection 1. Why didn’t we see the “polymorphic message”? 2. Why didn’t we came with a right solution?
  • 61. Why didn’t we see the “polymorphic message”  Because 'if' as a reserved word does not make us think in polymorphism
  • 62.
  • 63. How do we model 'age'?
  • 64. How do we model 'Weight'?
  • 65. How do we model 'money'? How do we model 'length'? How do we model 'speed'?
  • 66. We need algebraic expressions Let's see an example
  • 67. Now… let’s do some reflection 1. Why don't we use algebraic expressions? 2. How does affect our design not to use them?
  • 68.  Because 'common programming languages' only provide arithmetic models  Because we don't realize that a language is the beginning not the end.
  • 69. A programming language is its creator's state of knowledge
  • 70. How does impact our design a language without extensible classes? ArrayHelper?? xxxManager??
  • 71. How does impact our design a language where we can not see how it is implemented?
  • 72. How can we add specific behavior to an object? Let's see an example
  • 73. 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?
  • 74. How do we learn a new word?
  • 75. Do we: 1. Stop our brain 2. “edit" a new definition in our dictionary 3. “Compile” the new definition 4. Restart our brain?
  • 76. NO!! Why do we have to do it with our programs?
  • 77. Can our programs “change while running”? Can our programs “learn” as we learn?
  • 78. Yes, they can!... If they are METACIRCULAR Apply Eval
  • 79. Let’s see a problem: Can you make a proxy “learn” about its proxee as it is used?
  • 80. If we don’t have meta-circular languages, then we can not think about solutions where meta-programming would fit!
  • 81. Let’s think again… Are these concepts new?
  • 82. 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”
  • 83. Even More!  Static vs. Dynamic typing languages? Design? TDD?  Frameworks?  Relational Databases?  Web applications?
  • 84. Technical Deb Metaphor… Fuente: http://c2.com/cgi/wiki?WardExplainsDebtMetaphor
  • 85.
  • 86. Why not having closures generate debt?  Repeated code  Lack of abstractions  Difficult and costly to maintain
  • 87. Why not having meta-programming generate debt?  Some problems are more difficult to solve  More code!  Programs can not reason about programs or themselves  We always need a programmer to do something a program could do
  • 88. 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
  • 89. Conclusions  Learn other programming languages  Lisp/Scheme Smalltalk  Forth and more...  Learn our history
  • 90. We teach this and other important design aspects in our courses • OO Design I & OO Design II • TDD & Advanced TDD Check them out at: http://www.10pines.com/
  • 92. Muchas gracias! agile software development & services info@10pines.com www.10Pines.com twitter: @10Pines Argentina Tel.: +54 (11) 6091-3125 Alem 693, 5B (1001) Buenos Aires