Marcos Sandrini
2 min readMar 10, 2021

--

I should contest this article's points, in a little more polite way than Jason Knight did, although I agree with him.

I will start with a simple question: what is wrong with *IF*? What did it do to people who preach functional structures utterly difficult to read made just to bypass it? IF is a very natural way to read, has no performance overhead whatsoever, on the contrary: the structures the author and other people normally use to bypass the "nasty" if are bloated and impact performance in a very real way.

Also: the second example, the one that has 59 lines, sounds intellectually dishonest, sorry to say that. I know people get so excited with “new” stuff that they try to sell those in ways that end up being just unfair, out of sheer excitement. The first "bad" example would be not only wonderfully readable but much better in fact if you used the variable declarations you use from line 41 to line 45 there and especially if you used async/await, which is not something out of this world any more. In this way, the first example would be more readable and more performant, without resorting to this sort of “piping” that makes things seem too magical to be readable.

I don't think functional programming is inherently bad and I see good points in things like immutability, not to mention it was used to expose the overuse of object orientation, that is a great thing in itself. When someone gets too much into it for the sake of it only, though, you end up with unreadable pasta code for sure. I speak of experience, from having to refactor a "super-functional" project that was impossible to follow with all those “thenable” "point-free" structures.

--

--

Marcos Sandrini
Marcos Sandrini

Written by Marcos Sandrini

Designer and front-end programmer with 20+ years of experience, also a keen observer of the world and its people

No responses yet