OOP & Smalltalk:
back to the future

Pequeña reseña sobre orientación a objetos, Smalltalk, su influencia y estado actual.

¿Por qué?

Historia

Conceptos

Relevancia

Influencia

Curiosidad

Lenguajes paradigmáticos:

  • C (structured/imperative programming)
  • LISP (FP, Functional Programming)
  • Smalltalk (OOP, Object Oriented Programming)

Fundamentos de la OOP

(programación orientada a objetos)

  • Abstracción
  • Encapsulamiento
  • Polimorfismo

Qué es Smalltalk

Un lenguaje orientado a objetos puro

a.k.a. "Todo es un objeto"

Historia

Alan Kay

At Utah sometime after November  1966 when, influenced by Sketchpad, Simula, the design for the ARPAnet, the Burroughs B5000, and my background in  Biology and Mathematics, I thought of an architecture for programming. It was probably in 1967 when someone asked me what I was doing, and I said:

"It's object-oriented programming".

Xerox PARC

  • Ethernet
  • Impresión Laser (y networked)
  • Interpress (pre-Postscript, pre-PDF)
  • GUI
  • Personal Computer/Dynabook
  • Smalltalk (OOP)

Dynabook

Smalltalk

  • Object-Oriented Programming
  • Model-View-Controller Pattern
  • WYSIWYG Editors
  • Bitmap graphics (BitBlt, aka "bitblitting")
  • Overlapping windows, drop-down menus
  • Cut, Copy & Paste

Contribuciones de hace +30 años

  • Design Patterns (muchos)
  • TDD (Test Driven Development)
  • SUnit (JUnit, NUnit, xUnit, etc.)
  • IDEs
  • Refactoring Browser
  • Eclipse Project
  • Java 7 HotSpot VM (Strongtalk)
  • Google V8 VM (Strongtalk)
  • Ruby, Dart (influencer)

Contribuciones más recientes

Presente

Uso en Argentina

  • Telecomunicaciones

  • Banca/Finanzas

  • Petróleo y Gas

  • Retail

Uso en el Mundo

  • Más bancos y financieras

  • Logística (35% containers)

  • Gobierno/Inteligencia

  • Startups mercados verticales

exampleWithNumber: x
 
"A method that illustrates every part of Smalltalk method syntax
except primitives. It has unary, binary, and keyword messages,
declares arguments and temporaries, accesses a global variable
(but not and instance variable), uses literals (array, character,
symbol, string, integer, float), uses the pseudo variables
true false, nil, self, and super, and has sequence, assignment,
return and cascade. It has both zero argument and one argument blocks."	
 
    |y|
    true & false not & (nil isNil) ifFalse: [self halt].
    y := self size + super size.
    #($a #a "a" 1 1.0) do: [:each | 
       Transcript 
         show: (each class name);
         show: ' '].
    ^ x < y

Sintaxis

  • 100 factorial
  • 3 + 4
  • aCollection add: anObject
  • aDevice statusOf: #console at: DateAndTime now
  • Workstation withName: aString

Mensajes

Toda interacción se realiza mediante el envío de mensajes:

Control de flujo

  • Se realiza mediante envío de mensajes
  • No hay palabras reservadas (keywords)
  • Bloques (closures, lambda expressions)
  • [ "booleanExpression" ] whileTrue: [ ... ]
  • a < b ifTrue: [...] ifFalse: [...]
  • aCollection do: [:each | ... ]
  • aCollection ifEmpty: [ ... ]

Booleans

true y false son instancias únicas de las clases True y False

ifTrue: trueBlock ifFalse: falseBlock

    ^trueBlock value
ifTrue: trueBlock ifFalse: falseBlock

    ^falseBlock value

True

False

Virtual Machine

Image

Arquitectura

Simple things should be simple, complex things should be possible — Alan Kay

Back to the future

The immersive programming experience

Demo

(one-liners & snippets)

The best way to predict the future is to invent it— Alan Kay

¿Preguntas?

Gracias!

Links

OOP & Smalltalk: Back to the future

By Esteban A. Maringolo

OOP & Smalltalk: Back to the future

Reseña sobre orientación a objetos, Smalltalk, su influencia y estado actual.

  • 860