2 ms·
Articles like this sadden me deeply. There are too many Java programmers who are misinformed about the merits of their language and the supposed weaknesses of o
by putzdown 12y ago
Articles like this sadden me deeply. There are too many Java programmers who are misinformed about the merits of their language and the supposed weaknesses of other languages—especially C++. I've worked extensively with Java and C++ for nearly twenty years, so I know the ins and outs of each. I have never understood why people would say that the performance of Java has "caught up" with C++. It's not even close. When you use Java, you don't use it for speed. You want C++ for that. As for safety, C++ has made major strides in the last few years and is now, by virtue of features like std::shared_ptr<>, as safe as you want it to be. But that leads us to "simplicity." There's no question that Java wins here. C++ is an incredibly complicated language—a federation of languages, as Scott Meyers says. The benefit of C++ is that it can (as of C++11, anyway) marry both extreme speed and excellent safety—but to do so you either have to really know what you're doing or abide by a strict subset of the language. Java holds you to a stricter subset to begin with. There's a loss of power but a gain in simplicity.
Of course neither language is terribly safe as compared with a modern functional language, but that's not on the post author's radar.
Frankly, if I were choosing a set of languages to work with now I would not choose Java and C++. I'd choose C++ and Haskell, or some such highly pure language. Java provides a "blue collar" level of safety, but I find in general that the gains over modern C++ in this area are not worth the costs. If I really want a clearly safer language than C++ (or C), I want something a lot safer (and, preferably, faster) than Java.
But those whose careers are tied to Java will keep beating these drums. Sad.