|
|
|
|
|
by soulbadguy
1097 days ago
|
|
> Because it depends entirely on the use case. Every thing depends on the use case, and one case always find special case as counter example and most engineering solution/choices. Generalization are still useful and sometime "true". C++ (and native languages) are faster than java simply because it was designed this way. C++ chose speed at the price of complexity, safety and build time. Java on the other hand focused on simplicity and safety. I understand the idea of wanted to bring nuance, but the"it depends" can also become an excuse for bad tech choices. > There are plenty of cases where Java will be faster than c++ purely due to the available libraries. Hard to believe, but in that case i would say that you are comparing libraries, not the languages. |
|
If that were true, C and Rust (which are typically faster) would be just as complex as C++ (but no language is).
It chose to jump into the OOP fad while staying low level ("what if we had C with classes?"). That's the cause of most of the complexity. The rest is age, backwards compatibility handcuffs, and kitchen sink stuff from other languages like move semantics and functional stuff.
> Java on the other hand focused on simplicity and safety.
Java chose to jump into the OOP fad while being high level. Ruby and Python did the same thing, and they're also simple as a result. That or low level and not OOP are the correct combos if you don't want to wind up with something as byzantine as C++.