Hacker News new | ask | show | jobs
by throwawayjava 2856 days ago
> Does anybody else think functional programming is just one end of the either/or fallacy?

I think viewing this as a fallacy is a bit of a straw man. There are very few people who believe in a "Right Way (TM)" to write programs (although those people are probably over-represented in the comments section of online news posts about functional programming).

> Maybe a trap for contemplative people?

FP is hardly unique in this regard. Were you around in the 1990s? Recall that the OOP crowd got pretty philosophical there for a while, with elaborate treatises on software organized around some obscure book about architecture. ;-)

> The ultimate goal of software is to build something useful.

It's worth noting that the ultimate goal of functional programming (as a research field) goes beyond building software; (typed) lambda calculi are an entire alternative model for studying computation. The science of computation has many applications beyond software development.

1 comments

I think you're right that if FP is a trap at one end of the fallacy, pure OOP exists at the other.

Interesting point about software having uses outside of programming a machine to do tasks. I can see an appeal there.

> I think you're right that if FP is a trap at one end of the fallacy, pure OOP exists at the other.

I disagree; what spectrum are those on opposite ends of? Encapsulation, polymorphism, and inheritance are entirely compatible with FP, and immutability is entirely compatible with OOP. Functions and objects are equivalent. Most mainstream OO culture is centred around procedural programming, but it's the procedural parts that oppose a functional style, not the OO parts.

> I disagree; what spectrum are those on opposite ends of?

I also am not entirely sold on funfunfun's characterization, but if you think of this in terms of cultural hangups that cause excesses rather than concrete technical contributions then it makes some sense.

The excesses of OOP culture are distinctly different from the excesses of Functional culture.

OOP in excess looks like software architecture books with quotes from Alexander and FLW, programming as artform, etc.

Functional in excess looks like really bad descriptions of category theory promulgated by writers who couldn't tell you what group theory is good for.

So if we want to characterize these ways of programming in terms of what harmful excess looks like, then they are on sort of opposite sides of a spectrum. Where one side considers programming pure art and the other pure logic.

I'm still not sold that this is a good model of reality. But if you focus on excesses rather than useful insights, I can see what funfunfun is saying. I think.