SlideShare a Scribd company logo
1 of 61
The Technical Debt of the Programming Languages … and the influence in our designs Hernán Wilkinson – Jorge Silva Agile 2011
Fuente: http://c2.com/cgi/wiki?WardExplainsDebtMetaphor Technical Deb Metaphor… Debt Speed Burden Agility … if we failed to make our program align with what we then understood   … write code that is clean enough to be able to refactor as you come to understand your problem With borrowed money you can do something sooner than you might   put that learning back into the program
 
[object Object]
[object Object],Thinking implies Language
[object Object],[object Object]
[object Object],How do we call the whole thing?
[object Object],How do we call each part?
[object Object],How do we call each Traffic Controller in the Traffic Light?
aTrafficLight northSouthController eastWestController
aTrafficLight rightController leftController
aTrafficLight controller1 controller2
[object Object],[object Object],B. Lee Whorf (Linguistic Relativity)
[object Object]
[object Object],[object Object],[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
To avoid REPETITION To provide MEANING to that REPETITION
[object Object],Meta Note: I repeated the picture… I’m lacking an abstraction or a better image!  
[object Object],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?
[object Object],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;
[object Object],[object Object]
[object Object]
[object Object],Repeated code means we are forgetting an object!
[object Object]
[object Object],[object Object],[object Object],[object Object]
[object Object],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: }
[object Object],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?
[object Object]
[object Object],We need a BLOCK or a CLOSURE… …  an object that represents “code”
[object Object],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<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;
[object Object],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; List<Account> selectedAccounts = new ArrayList<Account> (); for (Account account: accounts) if (account.isOverdraw()) selectedAccounts.add(account); return selectedAccount; cutomers.select( customer => customer.nameStartsWith(“H”) ) accounts.select( account => account.isOverdraw() )
customers.select( new SelectClosure<Customer> () { public boolean value (Customer aCustomer) { return aCustomer.nameStartsWith(“H”); }}); cutomers.select( customer => customber.nameStartsWith(“H”) ) ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]
cutomers reject: [ :aCustomer | aCustomer nameStartsWith: ‘H’ ] (Smalltalk) customers.reject { | aCustomer | aCustomer.nameStartsWith(“H”) } (Ruby) customers.Where( aCustomer => !aCustomer.nameStarsWith(“H”))  (C#) reject List<Customer> selectedCustomers = new ArrayList<Customer> (); for (Customer customer: customers) if (!customer.nameStarsWith(“H”)) selectedCustomers.add (customer); return selectedCustomers;
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#) detect
customers collect: [ :aCustomer | aCustomer name ]  (Smalltalk) customers.collect { | aCustomer | aCustomer.name () }  (Ruby) customers.Select( aCustomer => aCustomer.name() )  (C#) collect List<String> customerNames = new ArrayList<String> (); for (Customer customer: customers) customerNames.add (customer.name()); return customerNames;
self  should: [ do something ] raise: Exception withExceptionDo: [ :e | self assert: …. ]  (Smallalk) C# Does not have one that I’m aware of … TDD: Test for exceptions Try { …  do something fail() } catch (Exception e) { assertTrue (…. ) }
[object Object],… and much much more…. Imagine how your designs would be if you could use closures
[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],Why do we have to do it with our programs?
[object Object],[object Object]
[object Object],[object Object],Apply Eval
[object Object],[object Object]
[object Object]
[object Object],Are these concepts new?
[object Object],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”
[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object]
Technical Deb Quadrant Fuente: http://martinfowler.com/bliki/TechnicalDebtQuadrant.html
[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
Questions?
[object Object],[email_address] www.10Pines.com twitter: @10Pines Argentina Tel.:  +54 (11) 4780-2460 Av. Monroe 2164 (1428) Buenos Aires

More Related Content

What's hot

What's hot (7)

SeneJug java_8_prez_122015
SeneJug java_8_prez_122015SeneJug java_8_prez_122015
SeneJug java_8_prez_122015
 
Practical scalaz
Practical scalazPractical scalaz
Practical scalaz
 
Type safe embedded domain-specific languages
Type safe embedded domain-specific languagesType safe embedded domain-specific languages
Type safe embedded domain-specific languages
 
Contracts in-clojure-pete
Contracts in-clojure-peteContracts in-clojure-pete
Contracts in-clojure-pete
 
Scalaz
ScalazScalaz
Scalaz
 
Functional Principles for OO Developers
Functional Principles for OO DevelopersFunctional Principles for OO Developers
Functional Principles for OO Developers
 
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]
 

Similar to The Technical Debt of Programming Languages

Generic Programming seminar
Generic Programming seminarGeneric Programming seminar
Generic Programming seminar
Gautam Roy
 
Linq Sanjay Vyas
Linq   Sanjay VyasLinq   Sanjay Vyas
Linq Sanjay Vyas
rsnarayanan
 
Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy code
ShriKant Vashishtha
 
Models, Programs and Executable UML
Models, Programs and Executable UMLModels, Programs and Executable UML
Models, Programs and Executable UML
Ed Seidewitz
 
Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01
google
 

Similar to The Technical Debt of Programming Languages (20)

Cómo Java afecta nuestros Diseños
Cómo Java afecta nuestros DiseñosCómo Java afecta nuestros Diseños
Cómo Java afecta nuestros Diseños
 
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
 
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
 
Generic Programming seminar
Generic Programming seminarGeneric Programming seminar
Generic Programming seminar
 
Linq Sanjay Vyas
Linq   Sanjay VyasLinq   Sanjay Vyas
Linq Sanjay Vyas
 
Ruby on rails
Ruby on rails Ruby on rails
Ruby on rails
 
ASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And RepresentationASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And Representation
 
Build an App with JavaScript and jQuery - LA - July 18
Build an App with JavaScript and jQuery - LA - July 18Build an App with JavaScript and jQuery - LA - July 18
Build an App with JavaScript and jQuery - LA - July 18
 
Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy code
 
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java Programmers
 
ASP_NET Features
ASP_NET FeaturesASP_NET Features
ASP_NET Features
 
Matlab Basic Tutorial
Matlab Basic TutorialMatlab Basic Tutorial
Matlab Basic Tutorial
 
Models, Programs and Executable UML
Models, Programs and Executable UMLModels, Programs and Executable UML
Models, Programs and Executable UML
 
Deck 6-456 (1)
Deck 6-456 (1)Deck 6-456 (1)
Deck 6-456 (1)
 
Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01
 
Web-First Design Patterns
Web-First Design PatternsWeb-First Design Patterns
Web-First Design Patterns
 
Web app-la-jan-2
Web app-la-jan-2Web app-la-jan-2
Web app-la-jan-2
 
Apex and design pattern
Apex and design patternApex and design pattern
Apex and design pattern
 

More from Hernan Wilkinson

More from Hernan Wilkinson (20)

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
 
Augmenting Smalltalk Syntax
Augmenting Smalltalk SyntaxAugmenting Smalltalk Syntax
Augmenting Smalltalk Syntax
 
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
 
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
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 

The Technical Debt of Programming Languages

  • 1. The Technical Debt of the Programming Languages … and the influence in our designs Hernán Wilkinson – Jorge Silva Agile 2011
  • 2. Fuente: http://c2.com/cgi/wiki?WardExplainsDebtMetaphor Technical Deb Metaphor… Debt Speed Burden Agility … if we failed to make our program align with what we then understood  … write code that is clean enough to be able to refactor as you come to understand your problem With borrowed money you can do something sooner than you might   put that learning back into the program
  • 3.  
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. To avoid REPETITION To provide MEANING to that REPETITION
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35. 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; cutomers.select( customer => customer.nameStartsWith(“H”) ) accounts.select( account => account.isOverdraw() )
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41. cutomers reject: [ :aCustomer | aCustomer nameStartsWith: ‘H’ ] (Smalltalk) customers.reject { | aCustomer | aCustomer.nameStartsWith(“H”) } (Ruby) customers.Where( aCustomer => !aCustomer.nameStarsWith(“H”)) (C#) reject List<Customer> selectedCustomers = new ArrayList<Customer> (); for (Customer customer: customers) if (!customer.nameStarsWith(“H”)) selectedCustomers.add (customer); return selectedCustomers;
  • 42. 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#) detect
  • 43. customers collect: [ :aCustomer | aCustomer name ] (Smalltalk) customers.collect { | aCustomer | aCustomer.name () } (Ruby) customers.Select( aCustomer => aCustomer.name() ) (C#) collect List<String> customerNames = new ArrayList<String> (); for (Customer customer: customers) customerNames.add (customer.name()); return customerNames;
  • 44. self should: [ do something ] raise: Exception withExceptionDo: [ :e | self assert: …. ] (Smallalk) C# Does not have one that I’m aware of … TDD: Test for exceptions Try { … do something fail() } catch (Exception e) { assertTrue (…. ) }
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57. Technical Deb Quadrant Fuente: http://martinfowler.com/bliki/TechnicalDebtQuadrant.html
  • 58.
  • 59.
  • 61.