What about Java?

Started by
2 comments, last by msjohnson 22 years, 6 months ago
I have some experience with C++ but now we are learning only java in college. They are really similar and, supposedly, Java is more advanced. Is there some advantage that C++ has over Java that makes it the prefered language, or are the two pretty much interchangable? thanks
Advertisement
JAVA as a language has evolved to be simpler to use and
still powerful..
unfortunately, it has a virtual machine.
JAVA has a better design framework.

C++ has no framework and is more complex with certain
constructs that java doesnt have. C++ can be quicker because
of its executable will always be native to the platform.

I prefer C++ to java, but i use java for school assignments
since i can easily program in win98 and run it
on the school sun solaris machine..

btw, solaris runs java lighting fast.. amazing because
my machine runs java like a turtle..
I think comparing Java and C++ is not really a good idea, the languages are targeted differently. Java is extremely useful if you need portable applications, for example for web-based applications and similar things. Java is quite slow when comparing it to optimized native code, and the memory footprint is just ... well BIG. Java has garbage collection, prohibits the use of pointers (that is, you can''t modify the machines memory directly), etc., which makes it high-level language (which doesn''t mean its better). C++, and especially C are, in contrast, low level.

One thing which makes me dislike Java is the Libraries/Classes coming with it. C++ does only have some very basic operations in its standard library, and you don''t really need to know them (such as the STL). Java, now, comes up with a lot of classes whose use seems to be inevitable to produce accetable code quality in appropriate time.

Using C++, however, you will often find yourself reading something about some API needed for this and that, such as the Windows API. Java provides classes for Window-Management, so to speak, these functions are ''included'' in the language.

In the end, performance-relevant applications have to use native code. Applications that need to be extremely portable will probably use Java.
I think if you are a hobby programmer, it is a matter of taste.

I personally do not like languages which do too much in the background, therefore I dislike Java, and do not make use of C++ features whose exact behaviour I don''t know. Also, not using pointers is like a world without sun for me ...
amen to that. I cant program anymore without pointers.

JAVA with JIT is actually quite good.. I did an assignment with JAVA, slow as hell. But with a few compiler tweaks, the program ran quite smooth.

you can actually write simple applet games with java, without worrying about nitty gritty details.

but i would recommend learning C++ though. Because C++
is simply the best overall language.

get a good compiler though, dont get stuck doing template''s
on a MSVC compiler which doesnt quite support templates.

its a real pain reading an example in a book and seeing your
compiler tell you its wrong..



{ Stating the obvious never helped any situation !! }

This topic is closed to new replies.

Advertisement