Game Development Community

Java and Me

by JavaKid · in General Discussion · 02/05/2011 (3:15 pm) · 12 replies

Hello,

I'm creating this thread so I can get advice on current programming languages.

Around half a year ago, I enrolled in an AP class that teaches Java. I'm doing pretty well in it, and beginning to move onto the more challenging, complex features of Java. Now that I'm starting to acquire a pretty decent "feel" for the Java language, a question arose in my head: What am I going to do with Java?

That's the question; "What am I going to do with Java?". What are some ways I can put my skills to the test? I've been thinking about taking a look into the game industry, but there are not many AAA engines that you can use Java with. Furthermore, there really are not any AAA titles that use Java (other than Runescape, but it's graphics aren't all that great; most Java 3D games are "laggy"). This led to another question: Is Java even worth learning?


Many AAA games in the market today use C++ (along with many, many engines). I'm pretty confident that if I was dedicated, I could continue my Java class and start teaching myself C++ along the way (I heard they are similar, correct me if I'm wrong). Is C++ worth learning? It's an old language, but there's a more important aspect... Many computers nowadays have a minimum of two processors, some having four to eight. It will only be a matter of short time before computers have many processors for a decent price. C++ can take advantage of multiple processing power, but not easily (I've heard it's a hassle). Do you think this will ever get "fixed"?

What do you think about me learning Java, and how can I "put my skills to the test" (it gets boring just going through course work, and not being able to use my fair Java skills in my own time)? What do you think about me learning C++? What do you think about the future of both of these languages?

Any help is greatly appreciated. Feel free to input your opinion.

#1
02/05/2011 (6:22 pm)
Quote:"What am I going to do with Java?"

Create Android apps, like everyone and their dog seems to be doing these days... just to find out that nobody wants to pay anything for an Android app.

Java is derived from C++. Some might say it is C++ dumbed down... ( e.g. none of those confusing pointers... I never had a problem with pointers myself, but I learned assembly language programming early on and knowing things at that level makes things like pointers easy to understand. ) or at least with a lot of hand holding to make sure you don't get yourself into trouble, often at the expense of speed/performance... like a mommy who will come in clean up after you also, when keeping things tidy slips your memory.

But actually they have different goals so comparisons are sometimes unfair. A google search of 'Java compared to C++' should bring a lot of results.

Knowing Java I am sure will give you a head start into getting into object oriented C++.
#2
02/05/2011 (7:04 pm)
This is really dangerous thread, ready to become a flamewar :)

If you wish to some day be a good programmer you better learn a few paradigms and several programming languages. You have no idea what you walked into if you think it's just about choosing between Java or C++.

Learn Java, learn C++, learn everything you can, it won't be enough anyway, you have to keep learning everyday.

You must become really good in Java or C++ and then some scripting language like Python or Ruby, that at least would open your mind a little. Then you should get into functional programming later on, some Haskell might be nice.
#3
02/05/2011 (7:33 pm)
Quote:Learn Java, learn C++, learn everything you can, it won't be enough anyway, you have to keep learning everyday.

This. A thousand times, this.

If the course you're taking is a good one, it's teaching you principles and concepts, and happens to use Java to provide examples of them. No harm done - you have to use something to write the example code, after all. Java is as good a choice as any, and better than many.

Your first programming language is the hardest to learn, because in fact you're learning two things at the same time; you're learning how to think and reason like a programmer, and you're learning how to express your thoughts and ideas in a particular language. So my advice is, focus on the first of those two tasks for now, and don't get too caught up in current or future language popularity.

Quote:"Well, in our country," said Alice, still panting a little, "you'd generally get to somewhere else - if you run very fast for a long time, as we've been doing."

"A slow sort of country!" said the Queen. "Now, here, you see, it takes all the running you can do, to keep in the same place. If you want to get somewhere else, you must run at least twice as fast as that!"
#4
02/06/2011 (12:01 am)
Just because no AAA engines are written in Java, that doesn't make it a bad language. And just because C++ isn't used in a lot of modern work doesn't make it outdated. Java is pretty great, and standard nowadays for very complex work (the Mars rovers were written in Java). It just isn't as low-level as C++, which makes it bad for game engines which constantly need to push the limit of current technology. Also, creating multiple threads on multiple processors is really easy in C++. As far as utilizing them well or doing anything else, I wouldn't know, I have no experience in that.

Try writing algorithms / solutions in Java, it will be the same thinking as C++. Learn C++ as well, teach it to yourself on the side, but expect to find it confusing for years to come. When you think you have the hang of it, it just means there is a feature you don't know about yet =P

But I think in the end it's more important to teach yourself programming, not a programming language. Learn everything you can, learn the logic and theory behind it.
#5
02/06/2011 (12:38 am)
It all boils down to what you want to be doing with your programming knowledge, if that is game development then Java isn't of much use and C/C++ is the standard you'll want to learn.

Also C/C++ might be old languages but there are still more lines of code written for them each year than any other programming language and that won't change any time soon. There are easier languages to code in but where performance is key you can't beat it.

From a general programming perspective I always try and advise people to learn a set of the most widely used ones C/C++, Java, PHP, Python, C# if you've got that base then picking up anything else is easy

#6
02/06/2011 (11:38 am)
First of all, I'd like to thank all of you for your long, detailed, helping responses. I actually asked this at two different game engine communities, and I'd have to say I'm much more pleased with the responses here, at GarageGames.

Quote:
Learn Java, learn C++, learn everything you can, it won't be enough anyway, you have to keep learning everyday.

That's a very good point. I didn't look at it from that view yet.

Quote:
Also C/C++ might be old languages but there are still more lines of code written for them each year than any other programming language and that won't change any time soon. There are easier languages to code in but where performance is key you can't beat it.

Yet, also very true. Another reason for me to pick up C++.

I'd have to say from these nice, well responses, I've been motivated to begin my C++ journey.

Of course, if anyone else wants to pitch in further, feel free :]

C++ and Me:
Do any of you happen to know some excellent sites, oriented towards beginners of the C++ language? I'd like to take a stab at some freebie stuff before I drop $50 on a book. If you know any, it'd be great if you could please let me know, thanks.
#7
02/06/2011 (12:15 pm)
You can get free books, too. This list has several I have in physical form, and could recommend:
www.computer-books.us/cpp.php

Java has its uses server-side. You'll generally use C++ and the rest of that family in the client, with stubs of Java if you're on Android, but there are many Java-based servers for multiplayer gaming. You'll put your Java knowledge to good use there, at least.

If you're looking to build tools in C++, don't go for the OS-specific solution on each platform (stay the hell away from MFC and Carbon, for example ;). Just get used to Qt or wxWidgets right away, and you'll live a better life. Learn APIs early, in other words. Java is its own world with its own APIs, while C++ is more of a split between the core language and numerous competing APIs. Qt and wxWidgets are two complete application frameworks, which means they don't just do windowing. Much preferred to something like Gtk+ (or even Gtkmm).

Each new language you learn helps making the next one after that even easier to learn.
#8
02/06/2011 (12:45 pm)
I had a bunch more C++ links but they are on an old machine. One I still use for reference and which I carried over to this new machine is:
www.cplusplus.com

I didn't learn C++ with their tutorial there but I have heard from others who have and they say it is a good one:
www.cplusplus.com/doc/tutorial
#9
02/06/2011 (1:19 pm)
I would second the www.cplusplus.com site that Gerry mentions it's a good one
#10
02/06/2011 (3:42 pm)
I use Java mainly for server side stuff and find it quite useful in that respect. There are multiplayer servers out there written in Java, and also the cross platform aspect makes it easy for me to test and develop locally on windows and then deploy the server software to a dedicated linux machine when ready.

jMonkey Engine looks good if you really want to do everything in Java, but I reckon the more languages you learn the better anyway.

#11
02/07/2011 (4:44 am)
Puppy Games http://www.puppygames.net produced several game exclusively in Java.

Minecraft is made in Java.

Even check out Farmville and pretty much every game in Facebook, they are all made in Actionscript (Flash).

Your success in the game industry will come from a great game, not a programming language.

The power in programming lies in the abstractions, leave the nitty gritty super efficient C++ code for the engine makers.

I have seen too many people work only on C++ and lacking skills for design and Object Oriented Programming. It is a harsh language for high level abstractions. Everything can be done in C++ but it just doesn't lend itself to it.

Before someone comes out hating me, I mean stuff like the Boost Librearies http://www.boost.org/. That is what I mean by high level abstraction and even if that is possible as they have proven it's really hard to express their ideas and design in C++. I think that people that are such big fans of C++ should know and use Boost (or similar) otherwise they are just lying to themselves thinking C++ is so great as they are just looking a the tip of the iceberg and missing out on so much.

Please don't forget to learn more stuff outside C++. It will empower you greatly and everything you learn will intertwine enriching the way you think about and solve problems with programming.

I'm a Scala fanboy and I personally don't like C++ as a language but it is a tool and I'm good at it and I keep trying to improve my understanding of it and the way I take advantage of it.

Learn Java, learn C++, learn everything you can, it won't be enough anyway, you have to keep learning everyday.



#12
02/07/2011 (7:08 am)
Minecraft counts *against* Java, though. Crashes frequently, badly optimised, runs worse than a Cider game on Mac. All the other examples are good, though :)

I don't really like Boost either. It adds things that should have been in the core language and/or have a cross-platform baseline of functionality. Unfortunately it's a pain to compile on some platforms and compiler versions, and I just don't have time to fight with the compiler when I could just whip out my library of ancient classes and functions, hack up something in <more fun API here> and relax.

But C++ is useful since most big game engines you can license are based on it. Compilers are getting better at producing better code without you having to use all sorts of weird (and potentially unreadable) tricks to get more speed out of it.