3 ms·
Probably you have only seen good and/or recent C++ code. Deep inheritance hierarchies are easy and cheap in Java (in fact, Java is deliberately designed to be
by HelloNurse 9y ago
Probably you have only seen good and/or recent C++ code.
Deep inheritance hierarchies are easy and cheap in Java (in fact, Java is deliberately designed to be good at them), but their popularity is older and wider; historically the early development of complicated OOP took place mostly in C++, with Java attempting to facilitate further complication with more modern tools.
For a well-known (and not too unreasonable) example of C++ deep class hierarchy, see the streams in the standard library of 20 years ago. The Java standard library copies them as closely as possible.
- marcosdumay 9y agoIn retrospect, it's indeed very likely that I have only seen good C++ hierarchies.