Which one is 'better'?What are their advantages/disadvantages? It seems that C++ is more powerful, however Java can be used online.
Which one is 'better'?What are their advantages/disadvantages? It seems that C++ is more powerful, however Java can be used online.
An Unofficial Cristiano Ronaldo Website : Ronaldo 7
Java is barely used online as applets nowadays. People use Flash. Java is easier to learn and is more "programmer-friendly." However, I recommend C++ because of its power, features and what not.
I learn Java first then C++, 2 years later. C++ all the way.
I personally use both. For quick multi-platform GUI development I prefer Java, whereas for anything else, I like C/C++.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Another important difference is that Java is interpreted whereas C++ is compiled. That means that running a Java program is much slower than a C++ one.
FAQ
"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.
"If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.
Yeah. But one bad thing about C++ being compiled is it can produce more serious errors whereas Java's errors usually just stop the program.Originally posted by joshdick
Another important difference is that Java is interpreted whereas C++ is compiled. That means that running a Java program is much slower than a C++ one.
No, most errors in C++ are caught at compile-time whereas Java's errors wait for run-time.
FAQ
"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.
"If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.
Java runs about 10% slower than C++ last time I did a test. Its pretty acceptable.
I can't think of any situations like that. You got some examples?Originally posted by joshdick
No, most errors in C++ are caught at compile-time whereas Java's errors wait for run-time.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Java is a platform as much as a language. although the syntax is related much of the design and philosopy is radically different. Java has much more power, as the word is originally used than c++. c++ is more low level than Java and thus, by definition less powerfull. This is not a bad thing, less power puts more decisions in the hands of the programmer and thus more control. An automatic transmission is more powerful than a manual transmission as your car is making more decisions. If you look at a class with virtual methods and non-trivial constructors it does more, is more powerful, but you can't make a copy with memcpy, can't save it to disk with write, can't read it from disk with read, can't include it in a union and so forth. A Java reference can do things that a c++ pointer cannot, like relocate or garbage collection. The JVM can even (under the right conditions) make that reference a simple imedeate location in the JIT code (like an automatic in c/c++) this comes at the cost of sometimes having that reference be a pointer to a pointer (possibly with some additional management beyond that). Different tools for different problems. Java is the best tool for creating programms for the Java platform. c++ is my prefered tool for creating computer programs.
I just go mad when someone says that something is more powerful than the other, and most of the time, it turns out that they have no idea what they are talking about (no offense Cris987, you are actually asking), did anybody else notice this powerful thingy?Which one is 'better'?What are their advantages/disadvantages?
It seems that C++ is more powerful, however Java can be used online.
now back to topic:
Both have uses, you should always Pick The Right Tool For The Job™, Win32 client programs in Java just suck, while network programming, servlets, multi platform programming rock, those just are examples btw.
Anyway, I highly recommend you to learn both, so you can pick up the one that suits the job better.
EDIT: fixed formatting and a typo, you can see the old version below
Last edited by glUser3f; 01-04-2004 at 04:18 PM.
gluser3f is right, learn both , it gives you alot more options for how to solve a problem, i.e. you need to make a GUI for a database program, you dont need alot of speed as it isnt a very mathematical intense program, so you would use JAVA for its easiness of making something like that. on the other hand, if you are making a 3d FPS , you would go with C++ or ASM because they give you more choices and are less bloated and provide the speed the game needs.
Thx guys...Originally posted by glUser3f
I just go mad when someone says that something is more powerful than the
other, and most of the time, it turns out that they have no idea what
they are talking about (no offense Cris987, you are actually asking),
did anybody else notice this powerful thingy?
now back to topic:
Both have uses, you should always Pick The Right Tool For The
Job? Win32 client programs in Java just sucks, while network
programming, servlets, multi platform programming rock, those just are
examples btw.
Anyway, I highly recommend you to learn both, so you can pick up the
one that suits the job better.
An Unofficial Cristiano Ronaldo Website : Ronaldo 7
>I just go mad when someone says that something is more powerful than the other
I feel the same way when somebody tries to compare two programming languages. The scope of such a comparison is way beyond a little thread like this one. Basically, the best answer you can get is an opinion (usually not well thought out either).
My best code is written with the delete key.
I like Java because it has so many features built into the language standard: concurrency, GUI classes, networking and much, much more.
C++ on itself cannot do much useful. You'll need additional libraries that aren't part of the standard.
The performance difference is often not important. I belive that future computer languages will be more like Java and Haskell and less like C and C++, with more layers of abstraction. Not many are programming in assembly these days.
Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling
as for the performace, it's not an issue any more for Java IMO, modern computers run Java apps quite well, and if Swing's theme is set to the OS native's, you hardly notice the difference.