3 ms·
Because functional programming isn't infinitely good, such that all need to consider costs is forever and totally erased. The costs and benefits of a particula
by jerf 2y ago
Because functional programming isn't infinitely good, such that all need to consider costs is forever and totally erased.
The costs and benefits of a particular programming style must be evaluated in the context of the language under examination. You can't take the benefits of functional programming in Haskell and blindly copy them into the benefits column of your Go analysis. You must actually do the analysis in the target language.
And once you do that, you will discover the cost/benefits of doing what most people call "functional programming" in Go is not very appealing. The costs magnify substantially and the benefits diminish greatly.
So... why would one do it?
(I qualify "what most people call functional programming" because my considered opinion is that "map/reduce/filter" isn't the interesting aspect of functional programming, but I'm still working on my guide on how to correctly bring the real lessons of functional programming back into imperative languages like Go, and this comment box is not enough to drop it all here.)
- FrustratedMonky 2y ago"Because functional programming isn't infinitely good," Some languages do make it harder, but functional programming is infinitely good. I hear god used functional programming when he made the universe. He tried objects once, I think C++, and accidently created Australia. Some error with multiple inheritance.
- jerf 2y agoWell, it depends on your point of view. According to the most respected Computational Theologian of our time, rather a lot of the universe is written in Perl [1]. Is Perl "functional programming"? One might argue it at least embeds a functional programming language within itself, but I suspect if we could do exegesis on the phrase "hacked most of it together in Perl" that it would not very strongly suggest the sort of elegance one nominally associates with Functional Programming. [1]: https://xkcd.com/224/ https://xkcd.com/224/