Avoiding to Reinvent the flat tire

1,183 views

Published on

How knowing our past will help us to avoid "reinventing the flat tire"

Published in: Software, Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,183
On SlideShare
0
From Embeds
0
Number of Embeds
32
Actions
Shares
0
Downloads
4
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Avoiding to Reinvent the flat tire

  1. 1. agile software development & services Avoiding to re-invent the flat tire Hernán Wilkinson Twitter: @HernanWilkinson www.10pines.com
  2. 2. Alan Kay “Our profession is like a pop culture” … “We don’t know our history”
  3. 3. The world “we live” in … ?
  4. 4. The world “we live” in … ?
  5. 5. The world “we live” in … ?
  6. 6. The world “we live” in … ?
  7. 7. Bret Victor - Thinking the unthinkable
  8. 8. How do we think about computing? How do we think about its tools?
  9. 9. Computing Alan Turing Alonzo Church
  10. 10. Computing Machine vs. Algebra
  11. 11. Programming Languages Algol-60, C, C++, Java, C#... Lisp, Smalltalk, Scheme, Self, Ruby, Clojure…
  12. 12. Lisp  Data = Code  Lambda Functions  Jit  GC (Reference Counting)  Meta-Circularity!!
  13. 13. Year?
  14. 14. Video Sketchpad
  15. 15. Sketchpad Ivan Sutherland Visual Programming Constrains Oriented
  16. 16. Year?
  17. 17. Simula 67  Software as a Model!  Organization of Knowledge  History tip:  Goto Considered Harmfull – 68  Structured Programming – 71 (using Simula 67 as prog. lang.!!)
  18. 18. Video Mother all Demos
  19. 19. The mother of all demos Douglas Engelbart Human Augmentation Mouse Direct Manipulation
  20. 20. Year?
  21. 21. Smalltalk  Xerox Parc - LRG Alan Kay Dan Ingalls Adele Goldberg
  22. 22. Smalltalk Lisp Simula 67 Flex Machine DynaBook Augment Children Comprehention Smalltalk (72,74,76,78,80) GUI - IDE Object Oriented VM http://www.youtube.com/watch?v=AuXCc7WSczM
  23. 23. Alan Kay "The best way to predict the future is to invent it" "I invented the term Object-Oriented and I can tell you I did not have C++ in mind.“ "Java and C++ make you think that the new ideas are like the old ones. Java is the most distressing thing to hit computing since MS- DOS.“ http://video.google.com/videoplay?docid=- 2950949730059754521 Smalltalk
  24. 24. Video Smalltalk Examples
  25. 25. Video Steve Jobs - Parc
  26. 26. Scheme
  27. 27. Closure Lambda: The Ultimate … (http://library.readscheme.org/page1.html)
  28. 28. Year?
  29. 29. Self  David Ungar – Generation GC, PIC, etc.  Randall Smith
  30. 30. What do they all have in common? Revolutionary Computer as a tool to augment human understanding Direct manipulation/Imm. Feedback Simplicity Consistency Concretenees
  31. 31. Let’s see some stuff that is not common YET, even thought it is old… 
  32. 32. Current Problems – Example 1 We don’t see code as objects
  33. 33. List<Customer> selectedCustomers = new ArrayList<Customer> (); for (Customer customer: customers) if (customer.nameStarsWith(“H”)) selectedCustomers.add (customer); return selectedCustomers; Looking for customers starting with H
  34. 34. 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; Looking for overdraw accounts
  35. 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; WHAT’S THE PROBLEM!!??
  36. 36. 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; We have repeated code!
  37. 37. How to remove “repeated code”  Copy the repeated code to “some place” (method, class, etc)  Parameterize what changes  NAME IT!!
  38. 38. Copy 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; class Collection<T> { public Collection<T> <<NAME>> { List<T> selected = new ArrayList<T> (); for (T anObject: this) if ( ) selected.add (anObject); return selected: }
  39. 39. 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?
  40. 40. We need an abstraction to represent code! (remember, code is not text!) closure…
  41. 41. Parameterize… 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;
  42. 42. 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;
  43. 43. 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() )
  44. 44. Meta-Conclusion Object = ¿Data + Code?
  45. 45. Meta-Conclusion Object = ¿Data + Code? If you think so, you don´t understand OO yet
  46. 46. Mete-Conclusion Data is an Object Code is an Object An Object is a “superior” concept that unifies data and code
  47. 47. 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?
  48. 48. Current Problems – Example 2 Programs don’t change while running
  49. 49. Current Problems – Example 3 We still think that code is text
  50. 50. Current Problems – Example 4 We don’t use objects all the way down We still using text as main communication media
  51. 51. So… Why is it not common???
  52. 52. The right question is: So… Why is it not common YET???
  53. 53. Conclusion If you don’t want to re-invent the wheel… If you don’t want to use a flat tire…
  54. 54. We have to learn our history We have to be open to challenge the status quo Do not accept new things as better things just because they are new Do not be an uncritical consumer!
  55. 55. Must Read  The early History of Smalltalk  Lambda the Ultimate …  Structure and Interpreteation of Computer Programs  Smalltalk 80  Lisp 1.5 user manual  Self papers  ACM Preccedings on HOLP  …
  56. 56. Must Watch Alan Kay on: Computer Revolution has not happened yet Normal Considered Harmfull The Dynabook: Past, Present and Future … and more! Structure and Interpreteation of Computer Programs Bret Victor videos Self movie
  57. 57. Must Learn Lisp/Scheme (Dr.Racket/Clojure) not cdr, car, etc. but apply/eval Smalltalk Self
  58. 58. Questions?
  59. 59. agile software development & services Muchas gracias! info@10pines.com www.10Pines.com twitter: @10Pines Argentina Tel.: +54 (11) 6091-3125 Alem 693, 5B Buenos Aires

×