I'm hacking almost exclusively in Erlang. It's a crazy language I visited a while back and ditched almost right away. Revisiting it after a year of FP feels like there's a lot I had missed.
Advantages I got right away from working with FP:
- I can't hack around and make code work out of the blue. You can end up doing that in an imperative language and your code will run without you knowing how. In languages like ML and Erlang you just can't.
- I get to think in abstraction ... seeing the wood from the trees.
- I never cease to get my mind blown over simple chop like this:
list_length() -> 0; list_length([Head | Rest]) -> 1 + list_length(Rest).
def list_length(l): counter = 0 for m in l: counter += 1 return counter
The point is I get to realize that setting a counter variable and adding to it like how we first learned counting fingers as a child isn't the only way. (remember the situations in which you ran out of fingers to count or just plain forgot where you were at and your friend kept counting? That's hilarious, but those things actually cause most of the bugs we pull our hair on decades later).