3 ms·
Java is a decade younger than C++. Also, I haven't ever seen deep C++ hierarchies. That seems to be invented for Java.
by marcosdumay 9y ago
Java is a decade younger than C++.
Also, I haven't ever seen deep C++ hierarchies. That seems to be invented for Java.
- HelloNurse 9y agoProbably 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.
- sanderjd 9y ago> Java is a decade younger than C++. I meant "more of a contemporary" as more so than Rust (which my parent comment was talking about). Certainly the design decisions (especially when it comes to object orientation) appear to me to be driven by thinking more contemporaneous with C++ than Rust's do.