59
agile software development & services Avoiding to re-invent the flat tire Hernán Wilkinson Twitter: @HernanWilkinson www.10pines.com

Avoiding to Reinvent the flat tire

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: Avoiding to Reinvent the flat tire

agile software development & services

Avoiding to re-invent the flat tire

Hernán WilkinsonTwitter: @HernanWilkinson

www.10pines.com

Page 2: Avoiding to Reinvent the flat tire

Alan Kay“Our profession is like a pop culture”

…“We don’t know our history”

Page 3: Avoiding to Reinvent the flat tire

The world “we live” in … ?

Page 4: Avoiding to Reinvent the flat tire

The world “we live” in … ?

Page 5: Avoiding to Reinvent the flat tire

The world “we live” in … ?

Page 6: Avoiding to Reinvent the flat tire

The world “we live” in … ?

Page 7: Avoiding to Reinvent the flat tire

Bret Victor - Thinking the unthinkable

Page 8: Avoiding to Reinvent the flat tire

How do we think about computing?How do we think about its tools?

Page 9: Avoiding to Reinvent the flat tire

Computing

Alan Turing Alonzo Church

Page 10: Avoiding to Reinvent the flat tire

Computing

Machine vs. Algebra

Page 11: Avoiding to Reinvent the flat tire

Programming Languages

Algol-60, C, C++, Java, C#...

Lisp, Smalltalk, Scheme, Self, Ruby, Clojure…

Page 12: Avoiding to Reinvent the flat tire

Lisp

Data = Code Lambda Functions Jit GC (Reference Counting) Meta-Circularity!!

Page 13: Avoiding to Reinvent the flat tire

Year?

Page 14: Avoiding to Reinvent the flat tire

VideoSketchpad

Page 15: Avoiding to Reinvent the flat tire

Sketchpad

Ivan SutherlandVisual ProgrammingConstrains Oriented

Page 16: Avoiding to Reinvent the flat tire

Year?

Page 17: Avoiding to Reinvent the flat tire

Simula 67

Software as a Model! Organization of Knowledge History tip:

Goto Considered Harmfull – 68 Structured Programming – 71

(using Simula 67 as prog. lang.!!)

Page 18: Avoiding to Reinvent the flat tire

VideoMother all Demos

Page 19: Avoiding to Reinvent the flat tire

The mother of all demos

Douglas EngelbartHuman Augmentation MouseDirect Manipulation

Page 20: Avoiding to Reinvent the flat tire

Year?

Page 21: Avoiding to Reinvent the flat tire

Smalltalk

Xerox Parc - LRGAlan KayDan IngallsAdele Goldberg

Page 22: Avoiding to Reinvent the flat tire

Smalltalk

Lisp

Simula 67

Flex Machine

DynaBook

Augment ChildrenComprehention

Smalltalk(72,74,76,78,80)

GUI - IDE

Object OrientedVM

http://www.youtube.com/watch?v=AuXCc7WSczM

Page 23: Avoiding to Reinvent the flat tire

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

Page 24: Avoiding to Reinvent the flat tire

VideoSmalltalk Examples

Page 25: Avoiding to Reinvent the flat tire

VideoSteve Jobs - Parc

Page 26: Avoiding to Reinvent the flat tire

Scheme

Page 27: Avoiding to Reinvent the flat tire

Closure

Lambda: The Ultimate …(http://library.readscheme.org/page1.html)

Page 28: Avoiding to Reinvent the flat tire

Year?

Page 29: Avoiding to Reinvent the flat tire

Self

David Ungar – Generation GC, PIC, etc.Randall Smith

Page 30: Avoiding to Reinvent the flat tire

What do they all have in common?

RevolutionaryComputer as a tool to augment human

understandingDirect manipulation/Imm. FeedbackSimplicityConsistencyConcretenees

Page 31: Avoiding to Reinvent the flat tire

Let’s see some stuff that is not common YET, even thought it

is old…

Page 32: Avoiding to Reinvent the flat tire

Current Problems – Example 1

We don’t see code as objects

Page 33: Avoiding to Reinvent the flat tire

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

Page 34: Avoiding to Reinvent the flat tire

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

Page 35: Avoiding to Reinvent the flat tire

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!!??

Page 36: Avoiding to Reinvent the flat tire

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!

Page 37: Avoiding to Reinvent the flat tire

How to remove “repeated code”

Copy the repeated code to “some place” (method, class, etc)

Parameterize what changes NAME IT!!

Page 38: Avoiding to Reinvent the flat tire

Copy repeated codeList<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: }

Page 39: Avoiding to Reinvent the flat tire

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?

Page 40: Avoiding to Reinvent the flat tire

We need an abstraction to represent code!(remember, code is not text!)

closure…

Page 41: Avoiding to Reinvent the flat tire

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;

Page 42: Avoiding to Reinvent the flat tire

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;

Page 43: Avoiding to Reinvent the flat tire

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() )

Page 44: Avoiding to Reinvent the flat tire

Meta-Conclusion

Object = ¿Data + Code?

Page 45: Avoiding to Reinvent the flat tire

Meta-Conclusion

Object = ¿Data + Code?

If you think so, you don´t understand OO yet

Page 46: Avoiding to Reinvent the flat tire

Mete-Conclusion

Data is an Object

Code is an Object

An Object is a “superior” concept that unifies data and code

Page 47: Avoiding to Reinvent the flat tire

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?

Page 48: Avoiding to Reinvent the flat tire

Current Problems – Example 2

Programs don’t change while running

Page 49: Avoiding to Reinvent the flat tire

Current Problems – Example 3

We still think that code is text

Page 50: Avoiding to Reinvent the flat tire

Current Problems – Example 4

We don’t use objects all the way downWe still using text as main communication

media

Page 51: Avoiding to Reinvent the flat tire

So… Why is it not common???

Page 52: Avoiding to Reinvent the flat tire

The right question is:So… Why is it not common

YET???

Page 53: Avoiding to Reinvent the flat tire

Conclusion

If you don’t want to re-invent the wheel…

If you don’t want to use a flat tire…

Page 54: Avoiding to Reinvent the flat tire

We have to learn our historyWe have to be open to challenge the

status quoDo not accept new things as better

things just because they are newDo not be an uncritical consumer!

Page 55: Avoiding to Reinvent the flat tire

Must Read

The early History of Smalltalk Lambda the Ultimate …Structure and Interpreteation of Computer

ProgramsSmalltalk 80 Lisp 1.5 user manualSelf papersACM Preccedings on HOLP…

Page 56: Avoiding to Reinvent the flat tire

Must Watch

Alan Kay on:Computer Revolution has not happened yetNormal Considered HarmfullThe Dynabook: Past, Present and Future… and more!

Structure and Interpreteation of Computer Programs

Bret Victor videosSelf movie

Page 57: Avoiding to Reinvent the flat tire

Must Learn

Lisp/Scheme (Dr.Racket/Clojure) not cdr, car, etc. but apply/eval

SmalltalkSelf

Page 58: Avoiding to Reinvent the flat tire

Questions?

Page 59: Avoiding to Reinvent the flat tire

agile software development & services

Muchas gracias!

[email protected]

twitter: @10Pines

Argentina

Tel.: +54 (11) 6091-3125Alem 693, 5BBuenos Aires