Platform-independent programmming with Java native code or C++ (QT, WxWidgets etc.)
I am asking myself if it would be easier and more flexible to program a multiplatform a开发者_开发百科pplication in Java and compile it to native binaries (the way Eclipse was written) or to use a cross-platform C++ framework like QT. Where are the advantages/disadvantages?
You will find less platform specific problems with Java, but:
- Some less commons platforms have C++ compilers/toolkits available but no JRE.
- With C/C++ you can usually access all native resources. With Java that is not always the case.
It depends on your preferences. If you have much experience with C++, then stay to it. Platform-independence alone is not an argument, as Qt does an excellent job on guaranteeing platform-independent code and everybody can recompile a program on another system (that's actually what you want to do with your Java programs, too).
I would just let the JVM do the compiling to native code.
You might assume its better to pre-compile it but for 98% of the time its not, it just harder and more complicated.
精彩评论