For learning, I'd suggest Java. For REAL game programming, I'd suggest C++. Java can do a lot of things that people used to claim were impossible.

It's a nicer syntax, but it gobbles system resources like Oprah at an all you can eat buffet.

There's ups and downs, and undoubtedly a lot of people are going to have their preference, and programmers tend to be rather passionate (Read: self-righteous morons) about their favourite thing. This is why the OS flamewars and console flamewars always turn out the same.

Don't listen to the zealots and fanboys. Both languages have their ups and downs.
In response to Ter13
For learning, I'd suggest Java. For REAL game programming, I'd suggest C++. Java can do a lot of things that people used to claim were impossible.

To claim something is impossible for a turing complete language is silly; infeasible is more likely. I've seen some real impressive stuff done in BASIC but it was likely much much more work than it was worth and would have been a lot easier in another language. Or like BYOND with the ray casting stuff. It works, just not well to be used decently in a game. That said I don't really think that applies to Java which is more than capable of doing any type of application it's just going to eat up more resources and be slower than the same thing done properly in C/C++.

There's ups and downs,

Yep if you're writing code that needs to run on a large range of micro controllers Java is certainly the language of choice as it is good at being cross platform and if that's your profession it'll probably be the language you'll be working with.

Don't listen to the zealots and fanboys. Both languages have their ups and downs.

Well I think everyone is going to be biased you just have to choose who seems the most reasonable about it and which language fits the needs of what you want to do. I personally dislike the Java framework especially when it comes to stuff like GUIs since in it's attempt to be cross platform you just get GUIs that do work on everything they're just awkward to use on everything since it can't properly make use of OS specific functionality so you're left with stuff which doesn't quite respond like you think it should. Plus I don't like the whole mentality of blocking off the programmer from low level functionality to save them. With something like C# which is very similar you at least can designate sections and variables to be located in unmanaged memory, take the gloves off, and do some serious low level optimizations and tricks which you just can't do in Java. The only thing you can do in Java is learn how it works well enough so that you don't run into pitfalls which drag your program down over inane things which don't make sense unless you know how Java is working underneath.

I don't like Java but it is by no means a bad language to learn from and it's good to pick up the OO concepts which it enforces. However anyone who plans to do serious programming work should eventually get their hands dirty and learn the low level concepts even if they don't directly use them much or at all because it helps you understand how things work which in turn lets you know what kinds of things will be fast and what won't along with a better understand of how memory works and such. I just think it's better early on before you get too attached to the crutches high level languages give you.
I'd suggest English first.

After you've mastered that language, we can talk about the good and bad points of the two languages you've mentioned:

Java is slower and more memory intensive than C++, and let nobody tell you otherwise. You can certainly gimmick up 'demonstrations' that show otherwise, but your average program will be significantly worse off performance-wise under Java, because it's compiled to bytecode and run on a virtual machine.

I personally don't like the way Java looks (Just some little things about it bug me), but it's perfectly workable. Something that might help you learn to program is that Java does not let you do a whole class of interesting and generally erroneous things, like access random memory - C++ does let you shoot yourself in the foot. The C++ way can be useful when you know what you're doing - when you don't, you'll just get gangrene and lose your foot.

C++ can be very platform-bound, depending on what you're writing and what libraries you're using. Java is theoretically platform-independant, but that's pretty much a lie in a lot of little corner-cases that the spec doesn't cover very well - in particular, you'll find that Java GUI code is write-once, run-nowhere.

In fact, if you want a GUI at all, just avoid Java.

A language you might want to look into for learning purposes is Python. Compiled to bytecode like Java, so slower and more memory-intensive than C++ (And slower than Java, too), but much nicer syntax.
In response to Jp
Jp wrote:
A language you might want to look into for learning purposes is Python. Compiled to bytecode like Java, so slower and more memory-intensive than C++ (And slower than Java, too), but much nicer syntax.

Not to mention Boost also has a library that (IIRC) integrates python scripting into an executable (similar to Lua).

But if you are a beginner I would definitely go with C++ if you are willing to wait longer for a more interesting result or go with Java if you want have results that are not that flashy.

[Note]
Why am I getting the feeling that I have just stated what I have already said in a different fashion?

George Gough
In response to Theodis
Theodis wrote:
It's like a crappy pair of plastic scissors designed to keep you safe at the expense of efficiency.

Nice simile there - I guess I'll go for C++ instead of Java then.
In response to Jp
Jp wrote:
Java is theoretically platform-independant, but that's pretty much a lie in a lot of little corner-cases that the spec doesn't cover very well - in particular, you'll find that Java GUI code is write-once, run-nowhere.

In fact, if you want a GUI at all, just avoid Java.

I don't care for the way Java GUI is handled, but I wouldn't go nearly as far as what you have said there.

In general, Java GUI doesn't let you make code that says "I want a button, I want it this size, and I want it here." Rather, your code says "I want a button, I have a preference for it to be this type of size (possibly relative to something else), and I want it in that general location on that side of the window." The layout manager system is, in my opinion, a poor way to do most applications I've wanted to write.

Still, once it is written and working, it works fine. What experiences have you had that you can say it's run-nowhere?
In response to Loduwijk
Probably the most irritating one was a simulator used for my Computer Systems course - basically, you loaded an assembled program for an imaginary processor called the DLX into it, it would run the program, and you could see what happens.

Unfortunately, the GUI was practically nonfunctional in Linux, due to the way some GUI elements were handled - I can't remember specifics, because it was a few years ago, but several of the buttons became zero-sized, IIRC.

The same program wouldn't run well in Windows, mostly because Windows timers apparently only have something like 10ms resolution, so the program would run in spurts. Not a GUI issue, just a Java thing.

Mostly, it's just lots of little annoyances that have built up. I have some ideological issues with Java, so I'm probably not the most non-biased respondant. :P
Page: 1 2