3 ms·
I know it's popular around here to dislike OOP, but this guy's main objection is to mutable state. Analogous situations can occur in an imperative paradigm wit
by amalcon 17y ago
I know it's popular around here to dislike OOP, but this guy's main objection is to mutable state. Analogous situations can occur in an imperative paradigm without objects.
You can easily make use of OOP with no mutable state. You don't get some of the features of OOP, but you can still leverage inheritance in interesting ways.
The other main objection is that OOP isn't a good model for all domains. Don't tell the OOP zealots I said this, but you don't have to use OOP when it doesn't model your problem well. Nobody forces you to use object-oriented techniques. Even if you're stuck with Java, you can just declare a bunch of static methods, and suddenly your "class" is a "module".
It's a tool, and like any other tool, it shouldn't hurt to have it in your box. Just remember to take it out only when it will help you.
- apotheon 17y ago> I know it's popular around here to dislike OOP, but this guy's main objection is to mutable state. Analogous situations can occur in an imperative paradigm without objects. To be fair, the guy's one reference to imperative programming made it sound worse than OOP.