Re:FP vs. OO, from the trenches
by asdasf on Monday July 22, 2013 @02:14PM
(#6085448)
The antithesis of FP is imperative. And OOP is imperative. Imperative programming encompasses both procedural and object oriented programming. Those are simply two different ways to structure an imperative program.
[ Parent
| on HN ]
I'd hesitate to call imperative the antithesis of FP:
It's imperative vs declarative - FP is on a different level of abstraction, as a sibling to, let's say, logic programming.
I'd hesitate to say that FP is on the same level as logic programming, or to say that it is declarative.
It really depends on what you mean by FP. If you refer to lambda-calculus or to say, the head/tail decomposition so common in FP, then those are inherently sequential and not really declarative. If you refer to functors / monads, then you're on to something, but then again, OOP doesn't really imply imperative.
>It's imperative vs declarative
Good point, I think the common tendency to refer to procedural programming as either procedural or imperative interchangeably got me doing the same thing with functional and declarative.