15. similar features:
Still we have religious
fights about them!
Classes
Inheritance
Polymorphism
Closures
imperative
...
16. Still we have religious
fights about them!
slightly different styles:
Indentation
Semicolons
Syntactic sugar
...
17. is this the holy grail of programming?
are we done?
18. accidental complexity
“Accidental complexity is complexity that arises in
computer programs or their development process which
is non-essential to the problem to be solved. While
essential complexity is inherent and unavoidable,
accidental complexity is caused by the approach chosen
to solve the problem.”
19. Causes side effects
Factories or Dependency
variables vs. values
Injection are a sign of
Accidental Complexity
class Rhino
{
private var _position:Point;
public function Rhino(position:Point)
{
_position = position;
or
_position = position.clone();
}
}
20. Side effects
Everyone needs to
observe everyone. observers / dispatching events
The environment stops
when observing it.
var rhino:Rhino = new Rhino();
var water:Water = new Water();
rhino.addEventlistender(Event.RHINO_JUMP, water.splash);
22. We are to familiar with
OO to see the problems.
Most programmers see syntax and and expressivity as the key features
in a programming language.
Whereas we really run into problems understanding larger applications
and also the effect that changes will take are very hard to predict.
23. A builder doesn’t need to
building blocks
know what happens
inside a brick.
Pointers in C
Object-oriented programming/design is meant to simplify our
lives by using object-oriented modules/libraries as our building
blocks for our program.
But without knowing the internals this is almost impossible.
(Pure) Functions are a far better fit for this purpose.
24. “Civilization advances by extending the
number of important operations which
we can perform without thinking.”
Alfred North Whitehead
25. now imagine you don’t know
anything about
object-oriented programming
27. Math theory:
Definition of functions
Their application
Functional languages
were developed to have a
clearer approach to
mathematics
lambda calculus
by Alonzo Church in 1930
28. functional-programming languages
1959
Lisp
1975
ML, FP, Scheme
1986
Standard ML
1990
Haskell, Erlang
2000
OCaml
2003
Scala
2005
F#
2007
Clojure
43. No classes, what types
data-structures
do we have??
Just use basic types
(Lists) and operate on
them.
Basically the same as we
already.
Code == Data
"It is better to have 100 functions operate on one data
structure than to have 10 functions operate on 10 data
structures." - Alan J. Perlis