How much easier is Java compared to C++

I know that Java is easier than C++. What I'd really like to learn is C++, but I'm having a hard time in school and am thinking that it may be easier if I just took the Java path. If I take Java when I look back I don't want to say: "I should have done C++" I want to say "Good thing I did Java, I wouldn't have been able to do C++."

So I'm wondering, how much easier is Java, or how much harder is C++ I guess I should say. I think I would be able to grasp Java, but I don't want to take C++ and have it go way over my head and end up dropping.

I want to make video games if that matters, but realize it's very difficult to break into the game industry and will probably do something else.

Thanks, Brad
No language is particularly easy... it comes down to personal taste in syntax. Every language has its own quirks and hardships. I suggest you learn both, being that C++ is generally more powerful and can be used to create any type of application, while Java is less powerful, but more flexible and portable and is more sought after in the industry.
closed account (3hM2Nwbp)
I'm not touching this one with a 60 foot pole.

Learn both :P
let's just say it's easier to shoot yourself in the foot with C++ than with Java, but it may actually depend on how smart you are

if you are really smart, then Java and C++ are equally easy/hard
if you are average, then C++ can be much harder than Java

learning Java wouldn't preclude you from learning C++, so why not learn it first if you feel that C++ could be too hard?

at the very least, learning Java will help you pick up good OOP habits

edit: for reference, check out chrisname's comments here:

http://www.cplusplus.com/forum/lounge/43522/

imho, he's one of the top 5 developers on these boards and he went back and forth to C++ before he felt comfortable with it

my personal experience was similar: I went from C to C++ and found C++ too complex so I went to Smalltalk next; coming back to C++ after Smalltalk helped me appreciate the OOP constructs a bit more - these days playing around with Scala helps me appreciate generic programming in C++ more

so feel free to jump around and learn various languages, but in general, Java should give you a good start
Last edited on
Last semester I took Java and C/C++ classes.. And to say that one language is easier than another is incorrect. Like mentioned above, it depends on preference and your own personal ability. In my case, I thought java was harder at times but C++ was harder at times as well; it goes both ways.

All in all, take both and see what you think. Taking both was very helpful to me because alot, but not all, of the concepts we're similar just different in syntax.
nah - Java is actually really easy if you come from C++

I've been using mostly C++ since it first came out, and Java on and off over the years

the issue is, the JVM does a ton of work for you in the background, whereas in C++, it's up to you to deal with a lot of details - that means you have be very disciplined in C++ or you end up with a buggy program

for example, in Java, with the garbage collector (GC), you don't have to worry about ownership issues - once none of your variables are pointing to the data any more, the GC will clean it up for you

with C++, you either manually deal with dynamic memory with ownership implied in your code (the object that calls new also calls delete), or you start using all flavors of smart pointers that imply various degrees of ownership, or you use memory pools, or you plug in some kind of generic garbage collector

you see these kinds of differences over and over again - in C++, you have more control over what the machine does, but that also means you have to be more explicit in your coding and actually exert control, which is nice sometimes, but can also be a hassle

I code in C++ 90% of the time these days, but I always find it shocking how much easier it is to get work done quickly when I jump back into languages like Java, or even better, Scala

closed account (1yR4jE8b)
I program in C++ on my personal projects to flex my brain muscles a bit, but at work we've moved to Python and Ruby and I'm grateful for that.
I think it might be better to learn C++ first, and here's why: Java was designed in many ways as "C++, but easier" in order to compel C++ programmers to learn it. If you learn C++ first, when you learn Java (or any other language, really) you'll go "man, this is really easy"; to give a physical analogy, it's like running with weights for some time and then taking them off. The fact that it was designed towards C++ programmers means that a lot of the reasoning involved when programming in C++ is valid in Java.
If you learn Java first, when you get to C++ you might feel discouraged because of how much harder it is. Java's syntax will also make you acquire habits that are standard in Java, but really bad in C++; most notably, in Java all objects go in the heap, while in C++ it's encouraged to move objects to the stack to avoid memory management bugs.
It's easier to learn something new when you don't have to unlearn something else.
on an aside to darkestfright's comment, both Python and Ruby are excellent languages for getting work done - for scripting, both are far superior to their predecessors (like perl or shell scripting)
Last edited on
I face same problem in my school. They taught us C++ But i don't like c++.
Please tell me the best way to learn c++.
learn other languages first and then come back to C++

for OOP, Java or Smalltalk or even scripting languages like Python
for low level data structures & pointers, C
for generics/functional programming, Lisp, Haskell, Scala

unfortunately, C++ only gets more complex over time (look at C++0x)

edit: actually, you may never like C++ - you don't have to like it - you may learn to like it if you can get C++ to do what you want, over time, but even then, you may find it easier to accomplish what you need to do in other languages
Last edited on
Topic archived. No new replies allowed.