I'm a C/C++ developer.
I am just intrigued why some of my colleagues are shifting to java. They actually have a lot to say why Java is better than C++. This is actually more of a trivial question, but I know for sure it would be a source of enlightenment for many also for novices like me.
Knowing only C++ and a little of java, how do you think could you convince a C++ developer to shift to java? If not, why stick to c++?
There aren't any good reasons to switch to Java. C++ is better than Java for systems and/or embedded programming, and there are many better alternatives for rapid prototyping.
Now, you tagged your question MFC even though it doesn't appear in the main text. I would recommend switching from MFC to one of the more modern C++ UI frameworks, because MFC is brain-dead, non-standard, fragile and very difficult to customize.
Reasons to stick with C++:
- Old C++ code base difficult/too much work to port
- Require use of specialized 3rd party C++ libraries.
- Low-level (hardware device driver) required control. C is considered a better language for that.
- Unable to run JVM on desired target platform.
Otherwise, I would choose for java as:
- The language is much "cleaner" (it's not necessary to be downwards compatible with C)
- The use of references instead of pointers make your life easier, much less need to write 'destructors'.
- My experience with switching to java/eclipse is that the refactoring tools make your life much easier. (Disclaimer: I'm not quite familiar with the latest C++ IDEs).
- I really like the amount of ready-to-use libraries, not only inside JDK, but also on Apache, etc.
In my opinion there is no good reason to switch to JAVA, if programming is meant for academic purposes only. But if you want programming language for personal use or creating commercial application you should try out c#.NET, python or other frameworks.
精彩评论