Functional Programming

Functional Programming (FP) was one of the issues we went over during the Scala demo I gave last Tuesday.

The resolution of that discussion was't to my satisfaction, not to mention following community entries that may picture FP as a concept that is open for personal interpretations. So, following are some clarifications about FP and its place in Scala.


Functional Programming:

FP has its roots in the Lambda Calculus, a formalism for representing functions and ways of combining functions, invented around the 1930s by mathematician (logician) Alonzo Church. Languages like Lisp and Haskell (named after Haskell Brooks Curry, a logician whose work is closely related to the Lambda Calculus) are considered "pure functional functional programming languages" and are influenced by this region of mathematics.


From Haskell's wiki: "Functional Programming means that programs are executed by evaluating expressions. This contrasts with imperative programming where programs are composed of statements which change global state when executed. Functional programming, on the other hand, avoids using state and mutable data."


This is it. No space for personal thoughts or considerations of any kind.




FP & Scala:

This is how the creators of Scala described it: "Technically, Scala is a blend of object-oriented and functional programming concepts in a statically typed language. The fusion of object-oriented and functional programming shows up in many different aspects of Scala; it is probably more pervasive than in any other widely used language. The two programming styles have complementary strengths when it comes to scalability. Scala’s functional programming constructs make it easy to build interesting things quickly from simple parts. Its object-oriented constructs make it easy to structure larger systems and to adapt them to new demands. The combination of both styles in Scala makes it possible to express new kinds of programming patterns and component abstractions. It also leads to a legible and concise programming style. And because it is so malleable, programming in Scala can be a lot of fun."