Which language should be taught to programmers that are just beginning: Java (yes) or C++ (no)?

  • Java is safer

    While being on one side of the fence and not the other is rather difficult because one should just use the right tool for the right job, but when it gets to common problems, Java is definitely the way to go.

    History proved that most programmers are not capable of handling memory efficiently on their own and while C++11 and up does make the task at hand easier to tackle it's still far from perfect. So, unless you have a requirement to use some hardware directly without any abstraction in between Java is definitely the one to go out of the two given. To add to that, when abstractions are not a taboo, there's multiple ways and even ready made libraries that actually allows to interface hardware through JNI (or JNA for that matter) giving enough flexibility even for the most demanding tasks so the only domain left behind is embedded software running directly on hardware and even that is changing.

    P.S.: Being easy to use on any platform without additional work is also a bonus if the product is going to be sold to multiple customers instead.

  • Java is easier

    Having done programming for 2 years, Java is pretty much easier to learn compared to c++, especially with those memory handling issues in c++. However, I would personally recommend learn the BASIC language first as that would give you the fundamental concepts of programming and only then you can progress to languages like Java and c++.

  • C++ exposes the basic machine architecture and the level of abstraction is really low (which is from my perspective a good thing).

    Since this is a black or white question i'll go with C++ for a variety of reasons .With C++ , the basic machine architecture is transparent to you the programmer (registers , virtual memory ,v-table ... Though some of these facilities you'll access via assembly) which is a good thing as this helps create a vivid image that you're interacting with a computer and not a black-box .The details can be overwhelming at first but once you master the beast i bet any language will be a pie in the sky . As a beginner someone would rather work from the bottom (C/C++) going up as this will assist you in understanding why some features in higher-level languages like garbage collection where implemented .

  • C++ is more powerful.

    Knowing how to program in C++ gives better knowledge of how things are done under the hood than when using Java. C++ is also one of the best languages to write libraries; one can say that C++ is more "able" than Java. The new standard C++11 makes it even easier and nicer to work with.

    However Java has a lot of official libraries ready to be used. I would say it depends on what you are trying to do. If you are aiming at computer science students, I would definitely start with C++ ; if you are aiming at people who want to learn programming more as a hobby you should go with Java. Java usage will come with a bit easier obtained results ; C++ will pave the way for more powerful, faster applications that also start faster. Java apps consume more memory than those written in C++, and they also start slower.
    C++ gives you more control than Java but with the expense of being a bit more complex, even though with C++11, things have been made easier.

    So if you want the people to whom you'll be teaching to easily write programs that have GUI and stuff like that, go with Java; if you are looking to teach them "depth" in programming, I would suggest to go with C++.

    Note: any 'real' C++ programmer can very easily and very quickly learn Java; however the inverse is not necessarily true.

Leave a comment...
(Maximum 900 words)
No comments yet.