PDA

View Full Version : C++ or Java



ankitsinghal_89
03-01-2009, 07:36 AM
I know basic C(not in deep,you can say simple basics) but now i want to learn C++ or Java.Firstly i want to know if i am taking a good step or not.
Secondly,I want to master atleast one language..

So please tell me which language i should pick C++ or Java.
I want really want to learn one of them to the expert level...

Please help out guys...

Akkernight
03-01-2009, 07:44 AM
I'd say C++, but I don't have a clever reason, other than that almost everyone on here says Java isn't as good as C++ xP
Someone will prolly give you a better reason ;)

Salem
03-01-2009, 07:56 AM
Oh goody, it's been several minutes since the last "X or Y" thread, let's have another one.

> So please tell me which language i should pick C++ or Java.
C++.

Actually, does it really matter?
Knowing "HOW" to program is far more important than the "programming with...". The former is real knowledge. The latter you can do with the "knowledge" and a decent book.

Actually, here's a better though.
"What kinds of programs actually interest YOU?"

There's little point in learning C++ if all you want to do is write web programs for example.

> Secondly,I want to master atleast one language..
C will take between 10 and 20 years (if you use it every day)
C++, with all the extra things is has, is probably unachievable in a lifetime.
If you just settle for competent, you'll be doing a hell of a lot better than a lot of people.

baccardi
03-01-2009, 08:03 AM
Knowing "HOW" to program is far more important than the "programming with...".

It's true, but programming with java you probably won't need soon to know how things work, because there are many classes already written for you the same thing with delphi, so i would suggest you learning c++

MK27
03-01-2009, 08:06 AM
I don't know either one, but as I understand it you can easily mix C code into C++, so depending on how good you are with C/and or how much you like it, you would probably be much more inclined toward C++.

But the world is a better place with alternatives, and they wouldn't exist if someone didn't choose them. So, thinking holistically, perhaps the best idea would be for me to learn C++ and you to learn Java! :cool:

ankitsinghal_89
03-01-2009, 08:07 AM
I have interest in graphical and game programming....

MK27
03-01-2009, 08:13 AM
I have interest in graphical and game programming....

Well, as it is now I believe that will be pretty much a C++ stronghold. This is why you have to get to work with the Java right away.

Seriously tho, before I started with C I worked with perl alot, which has O-O classes (that I didn't take much interest in). What I did do was write functions that dealt with some general principle (eg, for handling user data) and included a parameter to specify a specific task or method ("new" would parallel "constructor", I think) so the function was kind of like several functions rolled into one, possibly dealing with the same set of global variables or whatever. Then someone pointed out to me that this is object oriented programming and that I might as well use the class system (which I believe was a later addition to perl).

The point being, I doubt there is a limit to what you can do in most languages compared to another, it's really about the syntax of how you can do it. So obviously check them both out and decide what you like. In the end, if you pick Java and in a few years get to a point where you really believe what you are doing will work better in C++, it won't be such a big deal to switch over, methinks (that's the general knowledge).

Optionally, I would just stick with C for a while. Why not? If you need some excitement (you say you want to get into graphics and gaming) find an API and learn it.

Which brings up an important and very real difference (I would guess that 95% of API's available for Java are also available for C++, but the inverse is certainly not true).

Elysia
03-01-2009, 12:25 PM
If you want to write games, then C++ is your best choice, because that's what most modern games are written in.
Otherwise it's just apples vs oranges. No language is not superior over another in all sorts of ways. It's called using the right tool for the job.
So if not for games, the question becomes what do YOU want to do?
Choose the programming language based on that criteria.

VirtualAce
03-01-2009, 12:50 PM
I've talked with several Java programmers that have the incorrect assumption that since they can do Java they can do C++. This is not true at all since the languages differ greatly from one another. If you learn object oriented concepts that are not language specific then you will have a better understanding of how each language implements said concepts.

But asking which language you should learn on a C++ forum is a bit odd. Because we are going to say: C++.

But as has been said languages are tools so use the right one for the job and you cannot go wrong. Java just happens to be a tool that isn't in my toolbox. Perhaps someday when Java makes me money it will be but until then it means nothing to me. C++ and C# are my two languages of choice with C++ being my preference.

So where does that leave you? Right where you should be. The answer is which one do you need to learn first or which one do you want to learn first? We cannot make the decision for you.



> Secondly,I want to master atleast one language..


No matter how much you know about C++ and its applications there is always something you do not know. 'Mastering' when it comes to C++ is a very strong word indeed.

ankitsinghal_89
03-01-2009, 12:53 PM
Thx for the advice
i have one more thing to ask which is can java be learned without any difficulty without learning c++..

swgh
03-01-2009, 01:53 PM
As said before, they are two independant languages. You don't need to know C++ to learn Java, you do not need to know Java to learn C++.

The only thing it will give you is an idea of how the language concepts may work.