Hacker News new | ask | show | jobs
by WA 1313 days ago
> So I just don't really see how you can single out FP here at all.

Not OP but imho, it’s because FP is "sold" as the perfect solution for readability and code maintainability. Just use FP and nothing can go wrong. That’s at least the impression I get when I read about FP.

The fact that one can write abysmal OOP code is nothing new.

3 comments

> Just use FP and nothing can go wrong. That’s at least the impression I get when I read about FP.

To be fair that was the kind of nonsense that was being talked about OOP in the late 90's and early 2000's.

There are no silver bullets, and anyone who claims otherwise is flat wrong.

However most techniques have their advantages, when used well - and I'd say FP has more to offer than OOP in this context.

I generally agree with you. That said I do think the GP has a point w.r.t. Java and OOP. It's somewhat analogous in the sense that Java's main selling point was its ability to overdo OO abstractions.

What I don't agree with the GP is specifically the claims on other languages:

""" Python with immense amounts of spaghetti, C with its hard to control safety, abysmal imperative or OOP code in Typescript ""

These are not sold as advantages for the respective languages. Python doesn't say it's easier for the programmer to write spaghetti. C's unsafe constructs are a known side effect of being closer to the metal (and optimizing for speed at expense of safety). Typescript's selling point is type checking, which is orthogonal to abysmal code.

But FP is just sold as making it easier to make abstractions all the way down. And for many of us FP-skeptics, that's not a selling point, that's a turn off. (And to reiterate my original point - this is the same for Java, OOP and OOP-skeptics)

> it’s because FP is "sold" as the perfect solution for readability and code maintainability. Just use FP and nothing can go wrong. That’s at least the impression I get when I read about FP.

That’s because it is. FP is not immune to incorrect implementation. Both statements are true.