Settings

Theme

Ask HN: Three Uses of Inheritance?

1 points by rents 3 years ago · 2 comments · 1 min read


I seem to recall coming across a post or comment on HN or somewhere else (really sorry, I am not able remember correctly) about how inheritance can only ever be used in three scenarios.

I think it referenced an article or post from some professor.

One such was Inheritance for re-use. Other two I do not remember.

I have been searching on and off for quite some time but have not been able to locate it.

Can anyone help?

sargstuff 3 years ago

per "3" : Encapsulation, Composition, and Inheritance

"inheritance" types: single, multiple, multi-level, multi-path, heirarchical, hybrid

  • rentsOP 3 years ago

    nah, it was something like when to apply inheritance. One : Use it for code re-use to abstract out common code. There were 2 others.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection