I spent way too long trying to figure out how giving your kids your lifetime's earnings would be a performance hack beyond, you know, giving them a head start, before realizing what the headline was talking about.
Inheritance was invented as a performance hack
21–30 of 268 posts
Re: Inheritance was invented as a performance hack
#22Earlier quoted context omitted.
"Catching on" doesn't mean "is the right way to do things". Code reuse is in fact a prime example of a misuse of inheritance
Why is code reuse your prime example for bad inheritance? What should people do instead?
All code reuse can be expressed with composition and delegation, bringing more flexibility, testability, cohesion, decoupling, etc, etc, etc.
Re: Inheritance was invented as a performance hack
#23Earlier quoted context omitted.
"Catching on" doesn't mean "is the right way to do things". Code reuse is in fact a prime example of a misuse of inheritance
Why is code reuse your prime example for bad inheritance? What should people do instead?
Re: Inheritance was invented as a performance hack
#24I spent way too long trying to figure out how giving your kids your lifetime's earnings would be a performance hack beyond, you know, giving them a head start, before realizing what the headline was talking about.
Re: Inheritance was invented as a performance hack
#25Earlier quoted context omitted.
"Catching on" doesn't mean "is the right way to do things". Code reuse is in fact a prime example of a misuse of inheritance
Why is code reuse your prime example for bad inheritance? What should people do instead?
Using composition or lay out data differently may yield designs with more desirable properties. There's no one answer and it depends.
Re: Inheritance was invented as a performance hack
#26I think discussions of OOP and inheritance often miss the influence of Knowledge Representation on OOP: I’m not entirely clear of the history myself, but I’ve gotten the impression that knowledge representation research (things like frame systems) was a semi-independent influence on the design of OO systems
https://wiki.c2.com/?KnowledgeRepresentations
https://wiki.c2.com/?TypeInferenceStory
https://www.cin.ufpe.br/~mtcfa/files/in1122/Knowledge%20Repr...
Re: Inheritance was invented as a performance hack
#27Earlier quoted context omitted.
Why is code reuse your prime example for bad inheritance? What should people do instead?
Interfaces with default implementations are better than classes for a number of reasons, including the diamond problem, and that as systems grow large they almost never fit cleanly into an inheritance tree. Fat pointers with two words, one for an interface vtable and one for the object, work really well.
Re: Inheritance was invented as a performance hack
#28Fine. But obviously it caught on for other reasons, like code reuse and an intuitive mental model. The HN appetite for posts ragging on inheritance will never be sated.
Re: Inheritance was invented as a performance hack
#29I think discussions of OOP and inheritance often miss the influence of Knowledge Representation on OOP: I’m not entirely clear of the history myself, but I’ve gotten the impression that knowledge representation research (things like frame systems) was a semi-independent influence on the design of OO systems
c2 has some interesting thoughts on the topic. https://wiki.c2.com/?KnowledgeRepresentations https://wiki.c2.com/?TypeInferenceStory https://www.cin.ufpe.br/~mtcfa/files/in1122/Knowledge%20Repr...
Re: Inheritance was invented as a performance hack
#30Earlier quoted context omitted.
c2 has some interesting thoughts on the topic. https://wiki.c2.com/?KnowledgeRepresentations https://wiki.c2.com/?TypeInferenceStory https://www.cin.ufpe.br/~mtcfa/files/in1122/Knowledge%20Repr...
How is it that c2 has remained so quality?