Most of the interesting work I do is in C, so probably not the very top commenter on this, but I have some business in Java. I've seen some functional programming and I agree mostly on the point: "isolating side effects". All the other advantages are yet not very clear to me:/
Add pattern matching to the list. You combine function call, unpacking the
result, and branching based on its structure and/or value in a single
statement, without otherwise unnecessary intermediate variables.
Then add working with single-linked lists and pervasive recursion, which
somehow gives much higher level code and the right amount of friction to cause
functions to be shorter.
Callbacks being natural and obvious is a cherry on the cake (functions as
first-class objects is not that big of a deal, but it still helps a lot in
overall landscape).
It's not a single killer-feature of functional programming that make this
paradigm so loved by its practitioners, it's all the little things combined.
2 comments
[ 2.6 ms ] story [ 12.5 ms ] threadThen add working with single-linked lists and pervasive recursion, which somehow gives much higher level code and the right amount of friction to cause functions to be shorter.
Callbacks being natural and obvious is a cherry on the cake (functions as first-class objects is not that big of a deal, but it still helps a lot in overall landscape).
It's not a single killer-feature of functional programming that make this paradigm so loved by its practitioners, it's all the little things combined.