Contents    Prev    Next    Page+10    Index   

Functional Programming

A functional program is one with no side effects:

If we call sin(x), it will just return a value, but will have no side effects.

Functional programming does everything by composition of functions:


guacamole:
    season(mash(slice(peel(wash(avocado)))))

Functions are composed so that the output of one function is the input of the next function.

Functional programming works well with distributed cloud computing: the function can be replicated on many servers and executed in parallel on massive amounts of data.