This question has been on my mind for a while. I used C++ for some web development I was doing, and also some hobby programming. The only reason I got into it a little was because of the web development thing, as I just used plain C before. All in all, I didn’t use C++ too extensively.
Recently, I’ve been doing more extensive work with Java. Lots of people say that C++ and Java are completely different, and that doing thing the ‘Java way’ isn’t a good idea for programming in C++, suggesting that they are two completely different worlds. They certainly feel different, and function differently. But more specifically, what do people mean when they say that?
Are they talking about garbage collection? Or something else?
Thanks
Main difference is due to the fact that with Java you are running a program on a virtual environment (Java Virtual Machine) that you do not know, and that you are not allowed to access deeply.
This obviously generats a lot of differences, regarding level of programming and efficiency.
You can check this interesting link I found: http://en.wikipedia.org/wiki/Java_performance
And this SO question: C++ performance vs. Java/C#
Speaking in general terms C++ allows you to have more low level control of your programming.
e.g Java garbage collector manages memory without you knowing what it does:
instead in C++ if you want a sort of garbage collector module you must manage memory allocations by yourself.