Jump to content

  • Log In with Google      Sign In   
  • Create Account


Java or learn c++


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
28 replies to this topic

#1 zjr568   Members   -  Reputation: 114

Like
3Likes
Like

Posted 22 March 2013 - 01:53 PM

I have been learning java for the past 4 or 5 months. I started dabbling in making games about a month ago in java following some tutorials on YouTube and have found that I enjoy it quite a bit. I have been reading some of what people say around the internet and they say that c++ is much better for making games than java. I was wondering if I should switch to c++ and start learning it instead of continuing java. I haven't been able to decide and I hoped that you guys here would have more incite on this than anyone else on the internet. Thanks



Sponsor:

#2 JackBid   Members   -  Reputation: 453

Like
4Likes
Like

Posted 22 March 2013 - 02:02 PM

I don't use either, but I have heard that it really doesn't matter. There are great games made in java and great games made in c++. When you think about it, they are both incredibly popular languages and are for a reason, both are very powerful tools. If I were you I would simply stick to java, but if you think you will prefer c++ more, use that. I think it is more of a personal preference than a definite answer.



#3 Paradigm Shifter   Crossbones+   -  Reputation: 5250

Like
0Likes
Like

Posted 22 March 2013 - 02:16 PM

I'd say learn to make a game in Java first so you get the hang of programming, and then consider switching. C++ is not a beginner friendly language to learn. It's like someone tried to make an octopus by nailing 4 legs onto a greyhound ;)


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#4 minibutmany   Members   -  Reputation: 1568

Like
2Likes
Like

Posted 22 March 2013 - 02:20 PM

c++ is much better for making games than java

 

People argue that java is a little slower than C++, which may be true in numbers, but honestly it doesn't hinder its ability to make great games.

C++ is more difficult and complex than java and since you have already been learning java, you will prevent many headaches by sticking with java.

 

I won't tell you to not learn C++, it will certainly prove to be an excellent tool, but don't leave java behind just because someone said c++ was better.

 

Edit: I take back what I said about slapping in the face, but honestly people that think this are stuck in the days when java wasn't what it is today.


Edited by minibutmany, 22 March 2013 - 06:51 PM.

Stay gold, Pony Boy.

#5 Cornstalks   Crossbones+   -  Reputation: 6974

Like
8Likes
Like

Posted 22 March 2013 - 02:29 PM

If you aren't sure if you should use language X or language Y, chances are you aren't experienced enough to be doing anything that would make a significant difference either way. So just pick one. Using language X now doesn't stop you from learning/using language Y later. I've learned several languages, and I use them all (for different projects). Chances are, you will too.


[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

#6 zjr568   Members   -  Reputation: 114

Like
0Likes
Like

Posted 22 March 2013 - 02:39 PM

Thanks for all the answers everyone. Also I see what you mean Cornstalks. I am not doing anything complex enough right now for the language to affect it. My main thought was why learn java if it is obsolete to something else I could learn. Almost like why waste my time with it but like you said I will use java for other things in life so I might as well stay with it. Thanks again for everyone's input. Oh and one last thing. It seems like c++ is more widely used in game development than java. If this is true wouldn't there be more a lot more information online about creating games with it.



#7 Serapth   Crossbones+   -  Reputation: 5310

Like
3Likes
Like

Posted 22 March 2013 - 03:05 PM

 I started dabbling in making games about a month ago in java following some tutorials on YouTube and have found that I enjoy it quite a bit.

 

Other than the Youtube bit, you answered your own question.  You've been using Java for a few months, are making progress with it and are enjoying it.

 

Stick with it.

 

What other people tell you, tell them to blow it out their arse.  Opinions are like... oh wait, already covered that orifice.

 

 

 

Simply said, you've got a hell of a lot to learn still from the Java side of things, you are making progress and it's going well, so stick with it.  When you run into an actual barrier that you can't surmount, not a contrived one "other people" tell you that you are going to hit, then switch languages.



#8 EddieV223   Members   -  Reputation: 1406

Like
6Likes
Like

Posted 22 March 2013 - 03:09 PM

C++ if you enjoy low level optimization, complete control over your code, and/or knowing that your language is designed to run as fast as possible even if that means leaving open the possibility of making big mistakes.  Most game engines are wrote in c++ for these reasons.

 

Java is also a pretty good language.  It does a lot of extra work for you in attempt to prevent mistakes, it does this extra work even when you don't make mistakes.  Therefore it is not as fast as c++, nor does it offer you the same kind of control over your machine.  However the trade off means less mistakes, and therefor increased productivity.


Edited by EddieV223, 22 March 2013 - 03:10 PM.

If this post or signature was helpful and/or constructive please give rep.

 

// C++ Video tutorials

http://www.youtube.com/watch?v=Wo60USYV9Ik

 

// Easy to learn 2D Game Library c++

SFML2.1 Download http://www.sfml-dev.org/download.php

SFML2.1 Tutorials http://www.sfml-dev.org/tutorials/2.1/

 

// SFML 2 book

http://www.amazon.com/gp/product/1849696845/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1849696845&linkCode=as2&tag=gamer2creator-20

 


#9 Serapth   Crossbones+   -  Reputation: 5310

Like
2Likes
Like

Posted 22 March 2013 - 03:18 PM

complete control over your code,

 

Just curious, but what exactly in real world terms, do you mean by this.

 

At the tier of skill we are talking about at the beginner level, this expression comes up so often, but I cant imagine beginners really find they don't have the level of control over Java/C#/JavaScript/Lua/VB/etc... that they do over C++.  In 99% of my coding experiences, even though I've been at this professionally for almost 15 years, I rarely run into situations where I don't have complete control over my code.  I have on a few occasions thought I ran into such a situation, but generally it was my ignorance of how the language I was working in actually worked. The few examples I can think of are time of the time of garbage collection, byte ordering, implicit memory allocation and direct hardware access... and again, none of those things are something a beginner ( or often intermediate ) programmer ever runs into.



#10 tedsta   Members   -  Reputation: 258

Like
0Likes
Like

Posted 22 March 2013 - 03:30 PM

complete control over your code,

 

Just curious, but what exactly in real world terms, do you mean by this.

 

At the tier of skill we are talking about at the beginner level, this expression comes up so often, but I cant imagine beginners really find they don't have the level of control over Java/C#/JavaScript/Lua/VB/etc... that they do over C++.  In 99% of my coding experiences, even though I've been at this professionally for almost 15 years, I rarely run into situations where I don't have complete control over my code.  I have on a few occasions thought I ran into such a situation, but generally it was my ignorance of how the language I was working in actually worked. The few examples I can think of are time of the time of garbage collection, byte ordering, implicit memory allocation and direct hardware access... and again, none of those things are something a beginner ( or often intermediate ) programmer ever runs into.

I know I'm not the original poster, but you would have more control over the hardware with things like inline assembly, right? I'm fairly new to java, and correct me if I'm wrong, but you certainly wouldn't write an OS in Java, would you? But this thread is on Java or C++ for games so I won't pull the conversation that way.

 

I think both are great languages. I think since you're new and have already started with Java, stick with Java. I started with C++ and it took a few years for it to completely click (granted I was 10 when I started), Java has a kinder learning curve.


Current Project

World Storm

 

out our Android app! (My roommate and I)

https://play.google.com/store/apps/details?id=com.drsupersocks.ninja


#11 Nercury   Crossbones+   -  Reputation: 766

Like
1Likes
Like

Posted 22 March 2013 - 03:31 PM

A lot of concepts of making a game are the same across all languages. So I imagine if you are a beginner all that really matters is your skills going up :).

 

Right now I am prototyping some things in C++ and I find that it really is not quite as rapid as in Java or C#. So it has its disadvantages.



#12 GuardianX   Crossbones+   -  Reputation: 1492

Like
4Likes
Like

Posted 22 March 2013 - 03:31 PM

If you enjoy Java more, then go with it. It is true that C++ is superior in performance, but at the beginner level you won't notice the difference. But if you are up to take a slightly complex, but better path - go with C++. In the end - the game you have made is all that matters, not the tool you have chosen.

 

Edit: wrote something stupid, deleted something stupid


Edited by GuardianX, 22 March 2013 - 03:42 PM.


#13 Paradigm Shifter   Crossbones+   -  Reputation: 5250

Like
0Likes
Like

Posted 22 March 2013 - 03:33 PM

I'm 99.9% sure you can do function overloading in Java... you can't do operator overloading though and lack of unsigned types might be a bit of a chore if dealing with hardware directly.


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#14 GuardianX   Crossbones+   -  Reputation: 1492

Like
0Likes
Like

Posted 22 March 2013 - 03:41 PM

I'm 99.9% sure you can do function overloading in Java... you can't do operator overloading though and lack of unsigned types might be a bit of a chore if dealing with hardware directly.

 

Ah yeah, just checked that. Long time ago when I was working on android project it didn't work for whatever reason =\

 

Anyway in 3D realm C++ blows anything.


Edited by GuardianX, 22 March 2013 - 03:45 PM.


#15 Serapth   Crossbones+   -  Reputation: 5310

Like
1Likes
Like

Posted 22 March 2013 - 03:42 PM

 

complete control over your code,

 

Just curious, but what exactly in real world terms, do you mean by this.

 

At the tier of skill we are talking about at the beginner level, this expression comes up so often, but I cant imagine beginners really find they don't have the level of control over Java/C#/JavaScript/Lua/VB/etc... that they do over C++.  In 99% of my coding experiences, even though I've been at this professionally for almost 15 years, I rarely run into situations where I don't have complete control over my code.  I have on a few occasions thought I ran into such a situation, but generally it was my ignorance of how the language I was working in actually worked. The few examples I can think of are time of the time of garbage collection, byte ordering, implicit memory allocation and direct hardware access... and again, none of those things are something a beginner ( or often intermediate ) programmer ever runs into.

I know I'm not the original poster, but you would have more control over the hardware with things like inline assembly, right? I'm fairly new to java, and correct me if I'm wrong, but you certainly wouldn't write an OS in Java, would you? But this thread is on Java or C++ for games so I won't pull the conversation that way.

 

I think both are great languages. I think since you're new and have already started with Java, stick with Java. I started with C++ and it took a few years for it to completely click (granted I was 10 when I started), Java has a kinder learning curve.

 

In theory, yes, in reality no.

 

We are long long long gone from the day we poked directly at the hardware.  In the days of 16bit DOS and slightly less ( and this is when abstractions started taking over ) 32 bit DOS extenders, yes, we fiddled directly with hardware.  Now, unless you are writing drivers, not so much.

 

It's one of those things we talk about as a language feature, but unless you are hacking on an OS kernel or writing a device driver, you don't actually do in practice.  Especially not at the level of the OP.



#16 MichaBen   Members   -  Reputation: 481

Like
4Likes
Like

Posted 22 March 2013 - 03:42 PM

C++ is complex and easy at the same time, mainly because it lets you choice how to do things. If you choice the safe and easy C++ path development can go fast and smooth, but if you take the wrong turn you might up on a path that leads to certain death with no way to recover other then going back and starting over again. This is probably the biggest pitfall for new C++ programmers, the language doesn't prevent you from making a wrong turn, it allows you to mix automatic memory management with manual memory management, for example the compiler won't prevent you from calling delete on a stack variable, it will just horribly crash when you run the program.

 

That doesn't mean it's a bad language for beginners though, that depends on how your skills are and how patient you are. If you are planning to learn programming by diving straight into it and hope to succeed using trial and error, you probably shouldn't start with C++. However if you are patient and can refrain yourself from using certain language features before you understand how they work, it shouldn't be a problem. So called 'easy' language are no guarantee for success either, for example I started out with basic, which was considered easy, but the first attempts didn't turn out very well. And managed languages as Java certainly have their pitfalls as well, garbage collectors are unpredictable and can have some nasty side effects that are not beginner friendly.

 

Personally I would stay away from garbage collected languages and stick with predictable memory management systems, but that has a safe mode (preferable no undefined behaviour in debug mode, either safe and defined or debug assertion). Specially when you are learning, I rather have a debugger that says that you are doing it wrong, then a magic software component running in a second thread that attempts to silently fix your mistakes (specially as this sometimes fixes it the wrong way and you have no clue what happened). Question is, is there such a language, that is also suitable for making games...



#17 Serapth   Crossbones+   -  Reputation: 5310

Like
1Likes
Like

Posted 22 March 2013 - 03:44 PM

If you enjoy Java more, then go with it. It is true that C++ is superior in performance, but at the beginner level you won't notice the difference. But if you are up to take a slightly complex, but better path - go with C++. In the end - the game you have made is all that matters, not the tool you have chosen.

 

Edit: wrote something stupid, deleted something stupid

 

Yeah, this is a classic example of ignorance over the languages features, as opposed to an actual advantage. 

 

I don't mean that as an insult in the slightest.  It's just often brought up that C++ somehow gives you more control over your code, but in reality, for most day to day developers, it doesnt.

 

Unless of course you think rolling your own basic libraries == control over your code.  You can do that in any language, it's just in C++, you often have to do it.  This of course, ins't a positive.



#18 Serapth   Crossbones+   -  Reputation: 5310

Like
2Likes
Like

Posted 22 March 2013 - 03:45 PM

That doesn't mean it's a bad language for beginners though

 

 

Actually, that's pretty much exactly what it means.

 

 

 

Coincidentally, this comes up again and again and again in threads like this.  That the thing that makes C++ hard to use is memory management.  This is patently wrong.

 

This is what makes C++ fragile, there is a much different thing.

 

What makes C++ bad for beginners is a myriad of things.  The convoluted inheritance system, the fact its 4 languages mashed together, the horrible build process, the completely lacking standard libraries, the 20 years of legacy cruft.  These are the things that make C++ bad for beginners.

 

Memory management... not even close to the boogieman it's made out to be.  Don't get me wrong, it can blow up in your face, but its really no different then leaking an unmanaged resource in C# for example.


Edited by Serapth, 22 March 2013 - 03:49 PM.


#19 GuardianX   Crossbones+   -  Reputation: 1492

Like
-2Likes
Like

Posted 22 March 2013 - 04:24 PM

If you enjoy Java more, then go with it. It is true that C++ is superior in performance, but at the beginner level you won't notice the difference. But if you are up to take a slightly complex, but better path - go with C++. In the end - the game you have made is all that matters, not the tool you have chosen.

 

Edit: wrote something stupid, deleted something stupid

 

Yeah, this is a classic example of ignorance over the languages features, as opposed to an actual advantage. 

 

I don't mean that as an insult in the slightest.  It's just often brought up that C++ somehow gives you more control over your code, but in reality, for most day to day developers, it doesnt.

 

Unless of course you think rolling your own basic libraries == control over your code.  You can do that in any language, it's just in C++, you often have to do it.  This of course, ins't a positive.

 

Yes, things like DirectX make C++ stand out of the crowd.



#20 ISDCaptain01   Members   -  Reputation: 1375

Like
3Likes
Like

Posted 22 March 2013 - 04:37 PM

I like C++ since it has tons of game and graphics libraries for it, not to mention the sheer amount of tutorials and books on game programming that use C++.

Its not as hard as some people make it out to be, it aint close to the nightmare that calculus based physics was... lol






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS