7 ms·
The biggest problem with OOP is the concept of class hierarchies. They're an unnatural representation of units of work and state that force obtuse topological r
by echelon 4y ago
The biggest problem with OOP is the concept of class hierarchies. They're an unnatural representation of units of work and state that force obtuse topological reasoning where there should be none.
Traits and type classes are a much better solution that offer far more flexibility, yet still allow the programmer their own balance of expressiveness and rigidity.
Of course data can have defined behavior. Don't try to marshall it into genetic lineages of parents and ancestors. That's an orthogonal and entirely made up problem.
- zozbot234 4y agoTraits and type classes are broadly the same as interface inheritance. So there still is a hierarchy, it's just restricted to the interface layer as opposed to impacting the implementation.