2 ms·
Java isn't an improvement over C++ either though.. oops circular logic!
by dkersten 17y ago
Java isn't an improvement over C++ either though.. oops circular logic!
- eru 17y agoCitation neeed.
- dkersten 17y agoI'd say its about on par. Which is better depends on the problem your trying to solve. Sure, Java adds some nice features, like garbage collection and potential compile-once-run-elsewhere and a bunch of other things, but C++ has its advantages either. Heres a small few: C++ can have much better startup time. While I no longer buy into the speed thing (the JVM has become quite fast), I still find Java mesurably slow while starting up. So much, in fact, that projects like NailGun were started to improve things. I hear Java's floating point hurts everyone everywhere: http://www.eecs.berkeley.edu/~wkahan/JAVAhurt.pdf http://www.eecs.berkeley.edu/~wkahan/JAVAhurt.pdf C++ supports unsigned arithmetic, Java doesn't. Javas generics use type erasure. Checked exceptions in Java are a bad idea. C++ allows tight OS integration. And so on. While I'll be the first to admit that C++ is far from perfect, I also don't buy that Java improves it. One is better sometimes, the other is better other times, both are terrible in other situations again. I prefer C++ in more cases than I prefer Java, hence my comment. But.. maybe I missed the point of the comment I replied to, since memory management in Java might really be an improvement over C++.
- eru 17y agoThanks for the clarification. I guarded my original past by only speaking of memory management. I have programmed in Java and C++, but not enough to say which one is better. I tend to avoid both in favor of Haskell, Python, Ocaml, Scheme and the like. D also looks promising.
- dkersten 17y agoYou're welcome. I use both in work, though a lot more Java than C++, but I agree, when I'm given a choice (or working on my own projects) I, too, prefer to avoid them. I've used a lot of Python in the past and, for the past two months, have been using Clojure. Much much nicer to work in than Java or C++!