Having been a full-time C++ programmer for all of the past ten years, I recently had the unique opportunity of seriously studying Java almost 10-15 years after it started becoming popular. In the meantime I’m also playing with Python on a personal note. This affords me a unique perspective, of having seen the past and at the same time looking at two new languages with a fresh eye.
C++ vs Java in 2009 = Assembly vs C++ during the 1980’s
The impressions or the vibes that i get in this new learning process is eerily similar to the same doubts and choices i felt / read about during the initial stages of my education, while playing around with assembly, C++ and Visual Basic.

Needs assembly or C
Assembly was THE choice if speed and memory choices was paramount and nothing else mattered but it was damn hard to use. All the old timers claimed you had to know assembly to understand whats happening on the system and that C++ was only for productivity improvements. They lamented about how new minds never learned / worked seriously with assembly and hence where at a disadvantage when it came to figuring out what really happened inside the box.
However at the time (1980) C++ was fast catching up, even embedded systems where moving to C++(maybe without using the templates feature). Java currently is in the same state that C++ used to be in 1980 wrt assembly and there are many who clamour for C or C++ to be taught in universities rather than Java for the sake of better understanding.
How can Java be as fast as C++?
It is not. However the hardware that is around now is vastly superior to 1980 and 1990 hardware, which made Java seem slow THEN, in the same way C++ seemed slow in all those small devices compared to raw assembly or binary code. Our current crop of laptops are more powerful than the servers used during the time when Java was beginning to get popular. This improvement in hardware makes the difference in speed highly immaterial for all practical purposes, because human beings cannot make out the difference all that much between 500 and 50 microseconds.
Fast forward to 2010
C++ is what you require if you need pure speed like in the critical loops or core libraries. You could substitute the word Assembly instead of C++, in the previous line, had this post been written 15 years back.
But Java is more useful from a business point of view for application development due to increased productivity and more features. It is therefore no coincidence then that embedded devices like mobile phones (and even dog collars, according to Java books) are now running Java. In fact the last Nokia mobile phone that i bought was guided by the factor that it had a data port using which i could upload custom Java program onto it.
Java vs Python = C++ vs Visual Basic
When C++ used to be THE top language around, and assembly was gradually being kicked to the ground, there was something else in periphery, which was Visual Basic and all other RAD languages, which basically gave you forms based development and automatic memory management.

Internal IT or back office apps need not be cool
However they were nowhere as fast as C++ and hence where relegated to internal IT applications, which never needed to be as slick as professional, cool looking applications and could be developed fast enough.
Fast development is very critical when it comes to small shops with less resources or IT departments on a shoe string budget. Many business applications certainly fit the bill and where developed on Visual Basic. It is exactly the same situation now with Python when comparing it to Java.
Python in 2009 = Visual Basic in 1990
Developing using Python does definitely seem like a breeze with not much hassles around object orientedness or strict rules around exception declaration or big infrastructures. Is Python as comprehensive as Java, with as many no of apis as Java has ? Probably not, although it is fast catching up in popularity, like Java before it, caught with C++ and that is saying a lot. There is no denying the fact that Python and Ruby would soon have many programmers who are trained in it by choice.

Will run Python as fast as Java
I have not compared the performance of Java vs Python. But i assumed Python could be slower from what i have heard on the web. Please do correct me if iam wrong on the above aspect.
If the economy keeps growing like it did in the last ten years, we would soon have quad core or even eight core desktops a common place and would not have to worry about Python’s performance compared to Java. I just hope folks don’t introduce messy co-orporate stuff and make it verbose and bulky as Java before it.
3 cheers for easy coding !!!

June 16, 2009 at 8:47 pm
I’ve been developping for more than a decade now and I do absolutly agree with all the mentioned points. But This shouldn’t push us to hate or let’s say give up to some sense our C++ skills, remember that there are a bunch of coders hence tons of applications still written in pure C, avoiding C++ due to it’s extravagant generated assembly code. That’s to say that even if C++ is considered to be a killing machine there faster than it and so on.
Java could have been faster if Security wasn’t a major concern in its design, which is actually one of its strenght and robustness. But on the other hand, Java is just beautifull and very clear to maintain, and veeeeery portable.
I love Java
June 17, 2009 at 6:53 am
No one, who has already ratched up hard earned experience and skills in C++, would want to throw all that away. Starting over is always a pain.
However its obvious that C++ will continue to be confined to niche areas related to Systems Programming, both in mindsets and in job postings.
There is simply not much MFC in demand as it used to be AFAIK except for maintenance jobs. But there seems to be more and more Java and .NET being asked instead and some Python showing up albiet in small ways.
Therefore retaining C++ skills wouldn’t make sense to folks who want to be into application development but folks who want to stick around in Systems, wouldn’t have any reason to drop C++. But there is a much slimmer chance for new development opportunities to come by in this area too.
April 23, 2010 at 7:00 pm
For what it’s worth, most C++ programmers can learn java in less than a week. I’ve seen some learn it in literally hours. So, there’s no need to throw away your C++ skills and start over. Just layer some java (or C#) skills on top of them.
April 23, 2010 at 7:04 pm
Its true that you can learn any of these languages in a jiffy. But if you are not maintaining your C++ skills or not working on them for a time, all those things you knew and took for granted would soon start fading bit, by bit.
Unless you worked to retain them and the nuances of your knowledge. You never forget the language as such but the small tips and tricks and trap doors and the libraries might be harder to recollect after some time.
August 16, 2010 at 9:49 pm
I learned java before and I write VB6 for a living. I’m sure VB6 is faster than java (period) and almost all VB6 programs are shorter and easier to understand than java equivalents. On today multi-core PCs, VB6 programs run as fast as breeze ~~ Java is way way back behind..
August 16, 2010 at 10:53 pm
Yes that is definitely true that VB is much faster than Java and definitely so since it is compiled unlike the initial versions.
What i was trying to say though is that the comparison between VB and C++ then, is the same way today that Java and Python are compared.
December 26, 2010 at 10:51 pm
I want to deneme
December 31, 2010 at 12:43 pm
It’s too bad that Java is shackled by Oracle. I’ll stick with C++ until Java is truly open, or another language fills its spot. Besides, I find no productivity increase when I develop in Java. If anything, I am more productive in C++ simply because IDontHaveToTypeJavaNamesThatAreCrazyLong.
As for application development C++/Qt is an excellent way to go. Or Python/Qt if you’re a novice.
March 8, 2011 at 10:23 pm
Two other reasons not to worry about Python’s performance is that it will make no significant difference for most applications, which are IO-bound, and also that modern JIT compilers can make a lot of Python code run at nearly the same speed as native code.
March 29, 2011 at 6:07 am
🙂 True .. and what you said sounded exactly how i remember Java was positioned against C++ in the initial days …
June 15, 2011 at 11:51 am
your view on C++ is very shallow. C++ needs to be looked at together with Boost library and perhaps QT (for UI and db access). Having these two libraries (especially boost) exploring meta programming facilities of C++ makes programing in C++ a much more ‘modern’ experience.
You have memory management, complex threading model, expressive computation libraries all built in and with compile time verification (thanks to template meta programming) to catch errors earlier.
With C++ 2011 you also get functional closures, auto declaration, and many more modern language facilities.
Yes, do agree that what holds C++ language development back is it huge base of libraries/code that require downwards compatiblity. It is an impediment to rapid syntax changes.
Java now has this bagage too, Scala/Clojure even though are functional languages — the fact that they are based on JVM is holding them back.
June 15, 2011 at 4:43 pm
@vlad, I agree that boost and the new functionality makes coding in C++ easier or more powerful compared to BEFORE.
However, what holds back the development on C++ compared to Java is developer driven memory management for the user code and nothing else. More than its libraries, which is no less powerful, this is the feature which gives C++ its performance boost and at the same time makes it time consuming to code.
This and the multi platform support seems to have made Java an almost no brainer for companies, for any new development that does not require the power of C++, since it ends being cheaper due to the less time spend on working / studying it.
IMHO Java has overtaken C++ by a wide margin in all non-system level coding efforts, which is pretty much almost 95-98% of the market and there seems to be no going back to its hey days. I see the same effect in the job markets (check any job portals for the numbers)
Rails and python at the same time seems to be baying for JAVA’s blood much in the same way and this was what i had in mind when i wrote my blog entry.
December 9, 2011 at 1:15 am
I learned how to program python in only two months, and I am still using it today. I believe that the only difficult part in learning it is sprites and adding to groups, but I am considering learning another language, probably c++, but I can never find a solid answer. What language is best for processing speeds and graphics for game programming? PLEASE respond, I need an answer.
December 9, 2011 at 9:45 am
Well if you want to build games like Quake and stuff, C++ might be the only way out and even then you could re-use some of the openly available game engines to only develop content and save yourself from hard programming.
But these days you can use flash and tools like that to develop games for mobile and PC platforms as long the game play is your concern and not the graphics per se.
I guess you have to find out more about the kind-of games you like to build and then follow up on that.
August 14, 2012 at 3:01 pm
There are far too many people on here who say they have seen a unicorn.
Lets see the pictures.
I.E don’t make unqualified statements without providing the bench marks.
June 25, 2013 at 12:00 pm
Pretty! This has been an incredibly wonderful article. Thanks
for supplying these details.
July 6, 2013 at 11:01 am
Hi, just wanted to say, I liked this blog post. It was helpful.
Keep on posting!
December 25, 2017 at 11:47 am
Java is not unique in any way or form. Comparing Java to C is just wrong. Compare to C++ or python. Kotlin is the new language of Android app development.