Inheritance was invented as a performance hack
11–20 of 268 posts
Re: Inheritance was invented as a performance hack
#12Fine. 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.
What benefit does inheritance provide over importing files containing functions? Ruby and loads of other languages let you import files and those functions work like they were part of the class itself.
Re: Inheritance was invented as a performance hack
#13Fine. 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.
It's a bit of interesting history. I don't know why it would get a "Fine. But unrelated stuff" response.
Re: Inheritance was invented as a performance hack
#14Fine. 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.
"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
To be clear, I do agree with your assertion, however I'm having a hard time actually putting "how/why" into words.
Re: Inheritance was invented as a performance hack
#15I 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
#16Fine. 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.
"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
Re: Inheritance was invented as a performance hack
#17Fine. 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.
"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
Re: Inheritance was invented as a performance hack
#18Fine. 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.
Is this ragging on inheritance? I don't see much in the way of value judgements mentioned. The closest is an assertion that doing things for performance is not bad, which seems more like a way of heading off comments like yours than anything else. It's a bit of interesting history. I don't know why it would get a "Fine. But unrelated stuff" response.
> Personally, for code reuse and extensibility, I prefer composition and modules.
Re: Inheritance was invented as a performance hack
#19[I might be really really wrong here]
Re: Inheritance was invented as a performance hack
#20Fine. 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.
"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
Does that depend on how inheritance works in a particular language? For example, in Python it’s widely believed that inheritance is simply “a tool for code reuse” [0].