external next up previous contents index
Next: Procedural/structural Programming Up: 8.2 Programming: the General Previous: Object Oriented Programming

Functional Programming

 

[more to come]

Functional programming means calling that functions with some arguments. Those functions return a value, a list of values or multiple values. In most programming languages, function calls are done in the following way: function-name (argument1, argument2, ....)

Function calls often used in an embedded way, like outer-function(next-function(next-function(innermost-function(args)))) Here is a imaginary example:

  display-nicely
     (sort-list
            (retrieve-all-players(player-data-base, guest-data-base)
            :how alphabetically)
      )

Functional programming style is useful in several situations, e.g.

It is possible to mix functional and procedural and object oriented programming style. However this is not always a good idea. Ideally procedures ``sold'' as functions should just return a value and NOT modify permanent data-structures. This way others and even you can use your functions and *just* expect that they will take some data, do something with them and return the result back to your procedure for for further use.

If functions do alter data somewhere, you have to document that somewhere.



Daniel K. Schneider
Thu Apr 17 12:43:52 MET DST 1997