Hacker News new | ask | show | jobs
by paulddraper 1135 days ago
> How does that make any sense in OOP?

OOP inheritance forms a tree, and that is the language of trees (parent, child, ancestor, descendant, sibling).

> Why do Java beginner courses still teach Inheritance like it was 1995

> Why do they teach Inheritance and later introduce "favor composition to inheritance"? Doesn't this just confuse everyone?

Codecademy's course introduces inheritance in module 9 of 11, and calls it "deeper object-oriented" feature: https://www.codecademy.com/learn/learn-java

> Why does Inheritance have first-class syntax support in an OOP language like Java ("extends") whereas Composition usually needs to be "engineered" using some more complex patterns, e.g. DI?

Class members absolutely have first class syntax.

DI is composition with IoC container.