2 ms·
> i can't even think of a valid reason to use objects once you get past the cat/dog/animal example Because you have internalized the braindamage you claim othe
by nh23423fefe 4y ago
> i can't even think of a valid reason to use objects once you get past the cat/dog/animal example
Because you have internalized the braindamage you claim others have. If you think "an object in code corresponds to an object in the real world" then you are victim of the object=noun method=verb braindamage.
An object is just a tuple. A method is just a procedure with an implicit param. OO is a way to factor code into pieces and to name and reuse those pieces. inheritance is for liskov substitution.
- H4ZB7 4y agoinheritance is NOT for liskov substitution, and not even OOP fans will argue that as most even consider inheritance a mistake. inheritance is specifically to make a subclass with the same methods and allow overriding a select few. it's basically just a syntactic shortcut. you get the added bonus that it of course still satisfies the interface of the parent, which is the semantic part, but this is a vanishingly small benefit