Notes on Functional Programming paradigm 1: data and logic




Computer programs can be seen as data (structures, state) and logic (algorithms, behavior).


Data changes when data values (state) changes over time, logic changes mainly when different inputs lead to different computations. Just to be clear, conditionals are the most common ways to express changes in logic, and there are a whole set of ways of doing so that are equivalent to conditionals.

Programming effectively is about grouping together data and related logic and express properly the variations of the data and the variations of the logic.

The same problem can be solved by different programs, is some of them data can changes often, while in another data do not change, similarly in one of them logic can change a lot and in another one logic change very little.

Source: Implementation Patterns, Kent Beck, 2007



Print | posted @ martedì 9 novembre 2010 22:21

Comments have been closed on this topic.