On Wednesday 15 September 2004 02:35 am, Steven T. Hatton wrote:
Q: This question is for people with both C++ and Java experience. Do you believe there are features of Java that C++ could also have, and would benefit from?
I have several thoughts on this subject, not all related to your question... 1. The whole hardware-vs-human cost equation has changed since the C language was created. As a result, C (and therefore C++) is forever biased towards programmer-managed efficiency. On the other hand, Java uses a garbage collector which is biased towards system-managed efficiency. There are good and bad points to both. Yes, there are garbage collectors available for C/C++, but that doesn't change the mindset of most C/C++ professionals. 2. Java is more standardized on the platforms it supports than C++. Hence the "write once, run anywhere" mantra. Perhaps this is because Java comes from a single vendor whereas C++ is an open standard implemented by multiple vendors. Again, there are good and bad points to both. 3. Java provides an extremely well-rounded library and set of tools. And the cost for doing all this is zero or near-zero. It can be argued that C++ has various system libraries at its disposal, but those aren't guaranteed as part of the language. 4. Java offers an Enterprise Edition (J2EE) as an add-on. With it, you can accomplish web development that utilizes the same business logic or data access code used in non-web programs. To my knowledge, There is no multi-platform equivalent for C++. 5. Java development occurs at a hgher level of abstraction than C++. This is because develpers don't get bogged down with language-specific features as often (namely pointers, references, indirection, function tables, etc...). 6. C/C++ has the advantage of portable code. Thanks to gcj, native compilation for Java is possible, even on OS's that Sun doesn't support. The binaries tend to be a little bigger than those compiled with gcc (up to 20% in my experience), but that has been an acceptable trade-off. I think there are performance comparisons between gcc and gcj compiled apps on the web. 7. Its ironic that C++ is a 'standardized' language, yet C++ implementations are so widely different. And vendor extensions (notably from Microsoft) make the problem of compatibility even more difficult. Best of luck in your endeavors.... Chris