Let me explain what I mean in case you are unfamiliar with this trend.
.reduce and the like. And every kind of data is a
stream now for some reason.
The filter method, for example, returns a newly created array only containing the elements that pass the filter test function, and the filter test function gets passed in as an anonymous function or a lambda expression.
In Java, this style became very popular around the time of Java 8, when people started using streams, and they suddenly had lambda expressions. Before lambdas, Java was a nightmare.
It’s kinda cool, and useful in some cases I guess, but I see people suddenly using this coding style for every damn thing, and I just don’t get it. Not everything needs to be written to look like you are handling a
stream type. And when you do write code in this fashion, that is not functional programming. The one and perhaps only thing it has in common with functional programming is that these functions don’t mutate the data.
Haskell and Lisp are two languages that support for-real functional programming. I’m not a master of either. I just know enough of it to know that using the
.map method is not it.