Re:Inheritance was invented as a performance hack
by throwaway894345 on Friday April 30, 2021 @12:24AM
(#26989810)
My roots are in OO but for the life of me I could never figure out why people found inheritance intuitive beyond some automatic delegation (like Go’s struct embedding). I certainly don’t miss the guesswork of trying to figure out which class’s virtual method is being executed out of the dozen in the hierarchy (especially when one virtual method is calling other virtual methods).
[ Parent
| on HN ]
Re:Inheritance was invented as a performance hack
by junon on Friday April 30, 2021 @12:37AM
(#26989858)
Because some people understand "is a" better than "has a".
Re:Inheritance was invented as a performance hack
by squiggleblaz on Friday April 30, 2021 @08:28AM
(#26992532)
That's just a restatement of the original problem. Inheritance just is "is a" and composition just is "has a", so if a person doesn't understand why someone would find inheritance more intuititve than composition, they wouldn't understand why a person finds "is a" more intuitive than "has a".