This chapter covers
- Functional Programming Concepts
- Limits of FP in Java
- Kotlin advanced FP
- Clojure advanced FP
We have already met functional programming concepts earlier in the book, but in this chapter we want to draw together the threads and step it up.
There is a lot of talking about functional programming in the industry but it remains a rather ill-defined concept.
The sole point that is agreed upon is that in a functional programming language (FP) code is representable as a first class data item - i.e. that it should be possible to represent a piece of deferred computation as a value that can be assigned to a variable.
This definition is, of course, ludicrously broad - for all practical purposes every mainstream language (with very few exceptions) in the last 30 years meets this definition. So, when different groups of programmers discuss FP, they are talking about different things. Each tribe has a different, tacit understanding of what other language properties are implicitly understood to also be included under the term "FP".
In other words - just as with OO - there is no fundamentally agreed-upon definition of what a "functional programming language" is. Alternatively - if everything is a FP language, then nothing is.