4. “The computer programmer
is a creator of universes for
which he alone is responsible.
Universes of virtually
unlimited complexity can be
created in the form of
computer programs.”
-- JosephWeizenbaum,“Computer
Power and Human Reason”
Creadores de Universos
13. ZX81-FORTH BY DAVID HUSBAND
COPYRIGHT (c) 1983
: CTOF 9 * 5 / 32 + . ;
OK
: FTOC 32 - 5 * 9 / . ;
OK
77 FTOC
25 OK
14. FORTH
- Reflection
- Extensibilidad y Modularidad
- "Programación concatenativa” (Monoid)
- Simetría (invarianza):
- Everything is a Word
- Word executes
- Words receives parameters exactly the same way
another word
20. QuickSort;
COMMENT The recursive QUICKSORT procedure;
PROCEDURE quickSort(data) from: (first) to: (last);
VALUE first, last; INTEGER first, last; INTEGER ARRAY data;
BEGIN
INTEGER pivot, i, j, k;
SWITCH ss := loop;
IF first LESS last THEN BEGIN
pivot:=data[first];
j:=first; k:=last;
loop:
FOR i:=0 WHILE data[j] LESS pivot AND j LESS last DO j:=j+1;
FOR i:=0 WHILE data[k] GREQ pivot AND k GR first DO k:=k-1;
IF j LESS k THEN BEGIN
i:=data[j]; data[j]:=data[k]; data[k]:=i;
GOTO loop;
END;
quickSort(data, first, k);
quickSort(data, k+1, last);
END;
END quickSort;
Fragmento
ALGOL 60
21. Programming is complex
because of the large number
of conflicting objectives for
each of our programming
projects.
If our basic tool, the language
in which we design and code
our programs, is also
complicated, the language
itself becomes part of the
problem rather than part of
23. El diseño de los lenguajes
de programación
- The point of
programming languages
is to prevent our poor
frail human brains from
being overwhelmed by a
mass of detail.
- Whereas designing
programming languages
is like designing chairs:
it's all about dealing with
human weaknesses.
"Five Questions About Language Design”
- Paul Graham
24. –Alan Kay
“Most software today is very much like an Egyptian
pyramid with millions of bricks piled on top of each
other, with no structural integrity, but just done by brute
force and thousands of slaves..”
Arquitectura
26. Arquitectura
It is the pervading law of all things organic
and inorganic, of all things physical and
metaphysical,of all things human and all
things superhuman —of all true
manifestations of the head, of the heart, of
the soul— that the life is recognizable in its
expression, that form ever follows function.
This is the law.
Louis Sullivan The Tall Office Building
Artistically Considered
29. La función
- Queremos desarrollar un sistema que permita a las
personas indicar donde están y qué están haciendo en
cada momento.
- Para esto los usuarios ingresarán su “Estado”, que
corresponde a un mensaje breve que indica qué está
haciendo en cada momento relevante.
- La idea es que otros puedan saber donde está y que está
haciendo, pues es útil para coordinar las tareas de un
equipo.
- Para indicar su estado las personas no necesariamente
deberán tener acceso a un computador. Esa es la función.
30. La Forma
- Para cumplir esta función, permitiremos que los usuarios
envíen sus mensajes de estado a un sitio central, y
permitiremos que cualquiera pueda observar una linea de
tiempo con los estados de cada uno de los participantes del
sistema.
- Las personas que usen este sistema podrán elegir a quienes
seguir, y podrán saber quienes les siguen.
- Como queremos acceso desde cualquier parte, permitiremos
que los mensajes también puedan ser enviados vía SMS.
Esto impone una limitación al mensaje de estado, que para
ser compatible con todos los sistemas de mensajería por
celular de la época, implica que el estado estará limitado a
140 caracteres.
31. Usaremos un sitio web para consultar la
linea de tiempo de los demás participantes,
y para elaborar nuestras listas de usuarios
que nos interesa seguir, junto con consultar
el estado de nuestros seguidores.
Con todo esto, podemos construir este sitio
usando Ruby On Rails, en poco tiempo, y
podemos publicar en la web.
Lo llamaremos Twitter.
El Producto
40. There are two ways of constructing a software design:
One way is to make it so simple that there are
obviously no deficiencies, and the other way is to
make it so complicated that there are no obvious
deficiencies. The first method is far more difficult.
42. 23 de marzo 2015
Emmy Noether's 133rd Birthday
43. Teorema de Noether
"Cualquier simetría diferenciable,
proveniente de un sistema físico, tiene su
correspondiente ley de conservación”.
44. Simetría
En un sistema físico corresponde a una característica
(observada o intrínseca) que permanece sin cambio ante
una transformación
Por Teorema de Noether
Simetría del Espacio => Conservación del Momentum
Simetría del Tiempo => Conservación de la Energía
45. Principio de Sustitución de Liskov
(LSP)
Sea q (x) una propiedad comprobable acerca de los
objetos x de tipo T.
Entonces q (y) debe ser verdad para los objetos y del
tipo S donde S, es un subtipo de T.
46. void DrawShape(const Shape& s) {
if (typeid(s) == typeid(Square))
DrawSquare(static_cast<Square&>(s));
else if (typeid(s) == typeid(Circle))
DrawCircle(static_cast<Circle&>(s));
}
void DrawShape(const Shape& s) {
s.draw()
}
vs
49. "Principio de Noether
(Aplicado a OOD)”
LSP => la relación ISA está asociada al
comportamiento.
Conservación del Comportamiento
=> Diseño por Contrato
50. ..when redefining a routine [in a
derivative], you may only replace its
precondition by a weaker one, and its
postcondition by a stronger one.
postcond Rectangle::SetWidth(double w)
assert((itsWidth == w) && (itsHeight == old.itsHeight));