2 ms·
Functional programming has some serious problems, but that it doesn't allow quickly changing behaviour by introducing global state isn't one of them (I'd say it
by alkonaut 12y ago
Functional programming has some serious problems, but that it doesn't allow quickly changing behaviour by introducing global state isn't one of them (I'd say its one of the features).
It takes a whole lot less mental effort to iteratively produce a bad solution in OO, than a good solution in FP.
I don't have anything to back this claim up, but to me it seems the "solution space" in FP is a lot smaller than in OO. As soon as you have mutability everywhere, you are just one more if() or more one state away from achieving what you want. In OO there are a million bad solutions to every problem, so the chance that a group of mediocre developers eventually stumble over one of the OO solutions to a problem is pretty good. It's so good that you can almost be sure that given enough time, any group of developers will reach the goal of a working program (for some definition of working). This makes it appealing to business.
- spacemanmatt 12y agoHaving recently completed my first (small) Clojure project for a client, I don't think the solution space is small unless you're talking about a pretty constrained problem. Given a broad enough scope, there are many approaches/solutions in FP that can yield similar results.