Inheritance was invented as a performance hack
1–10 of 268 posts
Re: Inheritance was invented as a performance hack
#2Re: Inheritance was invented as a performance hack
#3Re: Inheritance was invented as a performance hack
#4The HN appetite for posts ragging on inheritance will never be sated.
Re: Inheritance was invented as a performance hack
#5I was once one of the "luky 10.000"[0] about this: https://www.snopes.com/fact-check/program-management/ [0] https://xkcd.com/1053/
Re: Inheritance was invented as a performance hack
#6Fine. 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
#7Fine. 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
#8Fine. 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.
I'm happy these days using languages like Rust and Go that avoid classical inheritance, so I'm not here to argue in favor of inheritance. I'm just irritated by the pile-on.
Re: Inheritance was invented as a performance hack
#9Re: Inheritance was invented as a performance hack
#10Earlier quoted context omitted.
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.
Many benefits (e.g. attaching behavior to instances rather than modules, though there are other ways to accomplish the same goal), many drawbacks (fragility, yoyoing, etc.). C could be described as "files containing functions", and C++ was originally "C with classes", so it's not like "files with functions" is a revolutionary idea. This is all extremely well-traveled ground. I'm happy these days using languages like…
Also, the way CLOS does inheritance avoids a lot of the drawbacks too by decoupling classes and inheritance from behavior.