Skip to main content
gamedev.net
🔒 Locked

C++ to Java

Started by Cain000 Mar 18, 2005 at 11:28 PM 6 replies 1.3k views
Original Post
Cain000
Cain000
I'm planning on buying two or three books on beginning C++ programing to read over the summer. I'm woried, however, that after I get a basic understanding of C++ I will get mixed up when I'm learning Java next year in a computer science class that I'm taking. If the two languages aren't very similar I shouldn't have a problem but if they are I might skip the C++ for now. The main question I want to have answered is if I learn two different programing languages so close together will I get mixed up. Thanks in advance for any and all answers that I get.
Doc
Doc
There would probably be one or two times where you might say to yourself, "Shit, that's only in C++, not Java!", though most of the time it's not too hard to differentiate the two. The syntax is similar in a lot of ways, but the standard libraries are very different.
Cain000
Cain000
Thanks, I was kind of worried about the two being too similar.
cignox1
cignox1
Yes, they have similar syntax, but that should only make easier your learning process (i.e. not having to study two different ways to make loops, two different conditional constructs, two different...). That said, they are different enaught to be able to identify them (classes declarations are a bit different, for example).
My suggestion is: go with C++ (that will make the things easier then) and when you have to start with Java, look for a document that explains the main differences, and study them while you learn Java.
KGodwin
KGodwin
Quote:
Original post by Cain000
I'm planning on buying two or three books on beginning C++ programing to read over the summer. I'm woried, however, that after I get a basic understanding of C++ I will get mixed up when I'm learning Java next year in a computer science class that I'm taking. If the two languages aren't very similar I shouldn't have a problem but if they are I might skip the C++ for now. The main question I want to have answered is if I learn two different programing languages so close together will I get mixed up. Thanks in advance for any and all answers that I get.


Go with Java first if you need to take it as a class. The problem with learning too many languages, if you are like me, is you sometimes will forget that bool is boolean in Java and that you need to use & to pass as a reference in C++ etc. But that's life, too much information and you sometimes grab for the wrong thing. As for it being a problem learning two languages close together, it depends on the person; some of us may have no problems, some of us may have tons of problems, and some may be inbetween. If you really *don't* know if you would get confused, I would just do it anyway then so you know that part of yourself better.
nprz
nprz
I write pseudocode first on paper, then change it to some language, and then put it on the computer. It is easier to draw things when you aren't at your computer.

But anyway, Java and C++ are different enough that you shouldn't mix yourself up too much. It shouldn't be much of a problem if you compile regularly, if you compile once a week and write code the entire time in-between then it doesn't matter which language you will have to clean up a lot of stuff.

The syntax of Java and C++ are similar, so you don't have to learn two different ways of writing code, just have to find the appropriate class, like string in C++ and String in Java :)
Cain000
Cain000
Thanks to everyone. From what you've told me I shouldn't get to mixed up. It sounds like it might actually be helpful to learn a similar language before I take the class. Expect to see me around more often now that I've gotten into the programming world. Thanks again.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.