C++ Or Java?

Old topic!
The last post in this thread is over 60 days old. Posting in this thread will be considered a bump, so please make an attempt to be courteous if you go ahead with it.

If the last post is over 6 months old, it may instead be a better idea to start a new topic. If you aren't sure about what to do, feel free to ask a staff member for help, or try to locate a 'general questions'-type thread if it exists in this (sub-)forum.
Feb 12, 2013 at 9:05 AM
Veteran Member
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Aug 21, 2012
Location: At a computer
Posts: 313
After talking about game maker in the "Legends of Piramidos" Game thread, i started to think about learning a real programming language and making a game with it.
Which programming language would be better for programming game's, C++ or Java?
And does anyone know of a really good book for either of those languages that doesn't cost more than 10 dollars used?
PS:How would i program a TSC like scripting language in a game?
 
Feb 12, 2013 at 2:07 PM
meep
"All your forum are belong to us!"
Join Date: Jun 12, 2009
Location: Dracula's Castle
Posts: 570
Age: 28
I've never used Java, but I can certainly say I like what I've learned of C++ so far.
I think Java is easier to learn though.

But if you've got no programming experience, give this a look, they show all sorta of fancy 3D stuff there but it's a great place to start screwing around with 2D. It's what I started out with, it was a pretty good place to jump in.
 
Feb 12, 2013 at 4:43 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 6000
Man I'm glad Carrotlord isn't here to fuff this up

Alright, I'm by no means an expert, but here's what I know / believe:

- It's not too hard migrate from C++ to Java but going the other way usually leaves a bad taste in people's mouths because they are too spoiled by managed memory and Java teaches you some bad habits.
- C++ is the de-facto industry standard language for high-end game development (i.e. big-name publishers that develop games for consoles and such)
- Java contains a wealth of functionality for rendering, I/O and networking that C++ just doesn't have (by design)
- There are multitudes of free libraries available for C++ that can help you do the above-mentioned things
- If you want do do something 3D in Java you're gonna have a bad time
- C++ and Java are both portable, but Java is generally speaking easier to transition since the JVM handles os-specific functionality in *most* cases.
- Java will give you weird errors that you may never figure out for your entire life.
- There are more than enough resources online that you shouldn't really need a book for either.

Overall, I'm of the opinion C++ is the better choice for game engine development due to flexibility and less stupid bullshit. But Java could work too maybe in theory.
Related: http://alleg.sourceforge.net/

You could also go with C# which is like an amalgamation of both, however I think the framework is only for Microsoft products (XBOX, Windows PC & Phone)
 
Feb 12, 2013 at 7:28 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 6000
OpenGL is a bit advanced for someone who's never programmed before. Allegro is a lot simpler for starting out as you can get a window up and pictures moving on it with ease and develop your skills. Even I don't use OpenGL atm but I guess I don't really have too much reason to either.
The best way to program anything is to get someone else to do it for you by reusing their code. Failing that, just read some tutorials on text parsing and come up with a solution that works for you. There isn't really any one "right" way to do it (although comparing the file character-by-character with a million if() statements like Pixel does is probably the wrong way).
 
Feb 13, 2013 at 3:31 AM
Been here way too long...
"What're YOU lookin' at?"
Join Date: Jan 21, 2007
Location:
Posts: 1111
C# or bust. The code is structured a hell of a lot better in a way that makes sense. No need for .h files or any bullshit.

But if you HAVE TO pick between C++ and Java, I'd say go with Java. At least it's straight forward.
 
Feb 13, 2013 at 3:49 AM
Veteran Member
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Aug 21, 2012
Location: At a computer
Posts: 313
I just got "Sam's teach yourself C++ in 1 hour a day(21 days)" 7th edition, and i'm going to start reading it soon...Wish me luck, that book is more than 800 pages long O_O. But if i can't get even the basics of it within the 13 day return period, i'll return it and buy a java or C# book, thanks for the recommendations!
 
Feb 13, 2013 at 4:40 AM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Jun 12, 2011
Location: 0x00000000 0xC00E0FF0 0xFFFFEFD4 0xC0000000
Posts: 108
If you want to make a game fast, go Java or C#.
But if you want the full powah of game development, C++, of course.
Ah, nothing beats DirectX.

EDIT: Have an open mind about the slow processing blahblah Java does. There are some game engines written for Java, which I haven't really tried, but I think they do seem promising.
 
Feb 13, 2013 at 6:00 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3712
Age: 28
Programming a game is going to be a pain in the ass regardless of your approach. Good luck.
 
Feb 13, 2013 at 6:50 AM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Jun 12, 2011
Location: 0x00000000 0xC00E0FF0 0xFFFFEFD4 0xC0000000
Posts: 108
liammillay said:
std::cout << "The first bit of C++ they give as an example is easy to remember. However i have a feeling the rest is going to be a pain in the ass." << std::end1;
It will, but that's the point. Programming in C++ needs a kind of discipline.
 
Feb 13, 2013 at 8:17 AM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Jun 12, 2011
Location: 0x00000000 0xC00E0FF0 0xFFFFEFD4 0xC0000000
Posts: 108
Way, way easy.

You don't have to mess with the low- and mid-level aspects of memory management in C#. Although there are still several concepts of C# that are similar to C++, e.g. OOP concepts.
 
Feb 13, 2013 at 12:28 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Jan 30, 2013
Location: Northville, MI
Posts: 20
Age: 23
 
Feb 13, 2013 at 3:43 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 6000
Dynamically typed languages are for people who are too lazy to plan and have no idea what they are doing
go home and turn yourself into a nice floral arrangement
 
Feb 13, 2013 at 9:30 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 6000
Top