|
|
|
|
|
by uzerfcwn
1093 days ago
|
|
At least in my social bubble, composition over inheritance has been the more popular guideline for two decades. Instead of a Manager class inheriting Employee and Contractor (which in turn inherit Person, which in turn may inherit other classes...), you'd separate employee and contractor into traits/interfaces and define distinct manager classes that implement the two traits. Of course, ultimately it's all classes and inheritance in C++ because there are no traits, but it's organized differently. |
|
> But despite the fact that many programmers out there have gone through bad phases like this and eventually come to smart conclusions about how to actually write good code efficiently, it seems that the landscape of educational materials out there still overwhelmingly falls into the “objectively bad” category.
So his frustration here is that there's tons of educational material that focuses on inheritance even when that's not what most experienced programmers are doing.