Functional programming is a way of programming that is not well-known in the Delphi community. It is nevertheless an interesting concept which, although it cannot be directly transplanted into Delphi code, offers insightful ideas that we can use in our programs. Before I start talking about patterns in functional programming, though, we have to answer a seemingly simple question – what is functional programming, anyway?
Functional programming is one of the programming paradigms, a way of coding that treats computing as an evaluation of mathematical functions. It is part of a bigger family called declarative programming. Declarative languages focus less on defining the flow of the program and more on describing the program logic. Think about how SQL works (indeed, SQL is a declarative language). When writing a SQL program, you tell the database what needs to be done but not how it should do it.