3 ms·
Objects/classes work best for datastructures (IMO). Outside that usecase, I think polymorphism via inheritance is generally a mistake. Programs manipulate dat
by cogman10 1y ago
Objects/classes work best for datastructures (IMO).
Outside that usecase, I think polymorphism via inheritance is generally a mistake.
Programs manipulate data and datastructures organize that data in a way that's algorithmically efficient.
The main issue with OOP is that without a very clear abstraction, it can be almost impossible to reason about code as you end up needing to know too much about the hierarchy of code to correctly understand what will happen next. As it turns out, most programmers are pretty bad at managing that abstraction boundary.
- FartinMowler 1y agoOOP is like alcohol: enjoyable in moderation but dangerous in excess. In moderation, an object is a data structure with associated functions (methods) that acts as a kind of namespace. If your data structure and functions are separate, you might start having function name collisions. Hopefully we won't see a prohibition against OOP.
- the__alchemist 1y agoI wouldn't even consider that OOP! (Goes into the definition discussion)