Skip to main content
gamedev.net
🔒 Locked

Is Java worth learning for getting into game dev?

Started by onfu Jan 8, 2004 at 12:01 AM 25 replies 1.7k views
Original Post
onfu
onfu
Hi. Of all the programming languages, I have the most hard copy and other resources available to me for Java, as well as a bit of help from my gf who touched on it at uni... Just wondering though if this is the language I should be focussing on in terms of who else uses it and how far I''ll be able to go with it? my main goal is to able to put my programming skills into game dev. I''ve got a good grounding in programming with a scripting language and have made some reasonably complex little arcade games, so I''m not concerned about language complexity and what may or may not be out of reach to a beginner, but rather how useful it''s going to be in the long run... I know that microsoft is trying to distance itself from Java and I''ve heards some other ill sentiment towards it aswell.. So I''m askin you guys...what do you reckon? thanks.
joelmartinez
joelmartinez
I say go with whatever is the most comfortable. The big thing right now is not learning a specific platform/API, it''s learning the basis of games.

ie. if you know how to implement A* in Java, it''s a hop, skip, and a jump away once you get your bearings in C++.

I look at it this way, if you''re looking to be ultimatley employeed by someone like EA, then you''re going to want to go with c++. If that goal is a ways off and you''re just starting out, go with either Java or C# (my personal favorite). It''ll let you get the game concepts down without being bogged down with learning memory management on your own.

Joel Martinez
http://www.codecube.net/
Joel Martinez
http://codecube.net
[twitter]joelmartinez[/twitter]
onfu
onfu
It''s not so much that i''m ultimately looking to be employed by a large company like EA, but rather that i''m concerned about weather or not my known language will cause any problems when I''m trying to join or start an indipendant dev team...

I''ve got an ok grounding in general game mechanics already (although the few breif times i did try and tackle A* it gave me a headache) so i''d really like to make my first choice the one I''ll stick with...

I just got told elsewhere that C++ is not harder to learn that Java, so on that advice i suppose I''ll go for C++ and hope for the best...
The_Incubator
The_Incubator
This will depend a little bit on your long-term goals and what you''re interested in developing.

As joelmartinez said, if you''ve getting started and need to learn fundamental concepts of programming and algorithms, and just figure out how a game works, you''ll probably have enough to keep you busy with any language.

But if you are interested in going into development professionally, or as you''ve mentioned, joining an independent project, you might want to shoot for what they use.

An argument I used a couple years ago, in a discussion of Java''s suitability for game development, was that if you search the job listings at Gamasutra.com for "java" you get 6 hits, if you search for "C++" you get 31. When I first tried that, about 2 years back there were actually no hits for Java, but I''m guessing that mobile gaming has made it a little more relevant.

If you really want to hop into a game project or get into the game industry, survey says C++. But beginners often make the mistake of getting too hung up on languages or APIs, when the fundamental concepts and algorithms (which work in any language) should keep you plenty busy before the language is an impediment. And remember that if you''re interested in working on an indy or open-soure project, they''ll probably just be happy to have the help, and more than willing to let you get up to speed on whatever language they use.
Aldacron
Aldacron
Java is a fine place to start. There are naysayers, who gripe about Java''s performance and quote five year old statistics, or who make excuses for why they think Java is a crappy language. But the facts are that Java games *do* exist (commercial and otherwise), they *are* performant, and the java games community is continuing to grow.

If you decide to give it a try, check out javagaming.org for support, code examples, and open source game development libraries. The community there is very helpful and supportive, and don''t flame you for using Java

blizzard999
blizzard999
game programming (and programming in general) has a lot of notions that are independent from the language.
The language is only the implementation of this notions.

Java is probably simpler than C++ but C++ is FASTER so every commercial games will continue to use C/C++; this does not mean of course that you cannot write an arcade game or also a 3D app under java...
AndreTheGiant
AndreTheGiant
This has been asked a million times. In general, the responses all tend to be to the tune of "use C++ instead, its better", except people write 2 or 3 paragraphs trying to sugar-coat it because just saying a blanket statement like that creates lots of arguments.

Long story short, use C++ for game dev, not java.
Maega
Maega
There have been very few Java commercial games sold in stores. Only one I can think of at the moment is Law & Order II

kwyjibo
kwyjibo
I love Java, but I honestly think that if your goal is to program games, then you should use C++. I say this becuase C++ is the industry standard right now and you will be able to find many more resources for it (games-wise) then you would for Java.

BTW, I believe RoboForge was also programmed in Java.

Raghar
Raghar
Difference between Java and C++ would depend almost entirely on the structure of your game and on JIT used for running. Things like 64 bit processor (with JIT created for it) and SSE2 could change speed of your program quite a bit. Current difference between a staticaly compiled code and JVM would be in my guess something like 1.05. So game that would require 1.2 GHz processor in Java, would require 1.147 GHz processor if staticaly compiled (One file for windoze, one for Mac one for Unix) You have got the Idea. Of course there would be situations when C++ would be better and situations where Java would be faster. I for example would consider JVM starting just before your program and not when OS starts as bigger isue. Current most common VM have no exe caching (no potential virus storage as well), so there could be some drags in first few minutes. However, I also consider programs without lost deletes and programs that runs more calmly and are in better multithreaded enviroment as more important than previous isues. No Valve like vulnerablity is important for net programming as well.

Of course this would be more important for you AFTER you''d learn some programming. Java has nice tutorials and free books, and you could get production ready compiler without any cost, aside internet ones. You would learn more fast programming in Java especialy if your girlfriend already has some knowledge. First biggest beginers problems are: I wrote "public static void main(string...." why it says error? One probably silly advice, you should try to do a little GUI programming fast. Not something fancy, just a window and text. In my opinion it''s more effective than try to test your programs on the console. Windows console is butt ugly. Also you should do programming at LEAST one year in ONE programming language. Otherwise you''d just learn commands of one language then learn commands of another, and you''d know a little about actual programming concepts.
So either start with Java or with mickerosoft copy of Java. Starting with Java would be better for your abilities in long term, in my opinion. Just be careful with the memory management. (Translated: learn something about it in the later stage of your education.)


No costs is isue for independend game developers. Higher productivity is ALSO isue for independend game developers. Ability to don''t blast out OS to its knees, after few hours of running is isue from user view. Less bugs and better testing is also big isue.

I also consider poor game hungry MAC users as target for developing. This apply on GUI hungry Linux users as well. (common unix saing: first our application should run from command line, next.... )




If "This has been asked a million times"
You are permited to copy this response and use it if there would be another simillar question. Just add > original post by Raghar.
Shannon Barber
Shannon Barber
Learn C, C++, some assembly, Basic, Lisp, Perl, & Python.

Then any language you are confronted with, will already be familar.

[edited by - Magmai Kai Holmlor on January 9, 2004 1:00:51 AM]
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
l3mon
l3mon
I learned C++ before I learned Java at uni, but I think the Java bit was quite helpful for getting more into OOP.
HenryApe
HenryApe
C++ is the most common language in the desktop and console game industry today but Java owns the mobile game industry, so you can get a job in games with either language.

You could benefit a lot from using Java if working as an indie (better portability, increased productivity, and security etc.).

The reason C++ has such a big hold on the major companies, and the reason it will probably survive for yet a while in the industry, is that C++ is currently the only language that runs on consoles. That is not a concern for most indie developers though.

Other issues, such as the performance myth, are mainly the concerns of 14 year old gamedevvers rather than professional developers (here is a recent benchmark for you kids).

[edited by - HenryAPe on January 9, 2004 2:22:58 PM]
dmikesell
dmikesell
quote:
Original post by HenryApe
C++ is the most common language in the desktop and console game industry today but Java owns the mobile game industry, so you can get a job in games with either language.

You could benefit a lot from using Java if working as an indie (better portability, increased productivity, and security etc.).

The reason C++ has such a big hold on the major companies, and the reason it will probably survive for yet a while in the industry, is that C++ is currently the only language that runs on consoles. That is not a concern for most indie developers though.

Other issues, such as the performance myth, are mainly the concerns of 14 year old gamedevvers rather than professional developers (here is a recent benchmark for you kids).

[edited by - HenryAPe on January 9, 2004 2:22:58 PM]


The problem with benchmarks is that they test small features in isolation. Write a 300,000 line FPS in Java and one in C++ - using best practices for both - and see which one performs better.



--
Dave Mikesell Software & Consulting
Nytegard
Nytegard
quote:
Original post by dmikesell
The problem with benchmarks is that they test small features in isolation. Write a 300,000 line FPS in Java and one in C++ - using best practices for both - and see which one performs better.


What exactly qualifies as the best practices though? I know certain practices which are highly used by some programmers I know, which make readability & maintainability extremely easy, but which are not too effecient.

Honestly though, I''d rather have a slower, less effecient, maintainable program to work on than a highly optimized obfuscated program.

In reality, the small benchmark tests are as accurate as you''ll get. For big programs, you''ll never get two people exactly the same skill in each of their languages. I''m willing to bet that few, if any (and most likely none) of the people who''ve been reading these posts could write Doom 3 to be better than Carmack in Java, or another none C/C++ language. At the same time, you get a Java guru, and probably the majority of C/C++ programmers here couldn''t outprogram him/her either.

Besides, beginning to learn programming, you won''t nearly be as effecient as a year from now, probably not even a month from now. I don''t know how many times I''ve rewritten certain pieces of code, because although I''d like to think that I know it all, I don''t, and I learn new and better ways to approach things.

My opinion... Sure, learn Java. It might not be C/C++. but it is a very good language to learn for programmers. Learn to program before learning to program games. Eventually you may be working in Java, and trying to implement something, and see that it just cannot be done easily, and evolve into programming C/C++.
HenryApe
HenryApe
quote:
The problem with benchmarks is that they test small features in isolation. Write a 300,000 line FPS in Java and one in C++ - using best practices for both - and see which one performs better.

Yes, most benchmarks are indeed pointless, including the one you suggested. As long as the project performs well enough, things like the time it took to implement the project, the number of defects, portability etc. determines the value of each solution.
quote:
My opinion... Sure, learn Java. It might not be C/C++. but it is a very good language to learn for programmers. ... Eventually you may be working in Java, and trying to implement something, and see that it just cannot be done easily, and evolve into programming C/C++.

You might want to learn C++ before Java. I know I'm not the only one who has felt frustrated when going back to C++ and being forced to manually deal with a bunch of crap that smarter languages do for you.

[edited by - HenryAPe on January 9, 2004 7:03:44 PM]
Aldacron
Aldacron
quote:
Original post by dmikesell

The problem with benchmarks is that they test small features in isolation. Write a 300,000 line FPS in Java and one in C++ - using best practices for both - and see which one performs better.



Does it matter which one performs better if they both meet the project goals? And if the Java programmer finished ahead of schedule and under budget, would that have any impact? Both of these are ''what if''s'' mind you, but having the ultimate performance possible is really pointless as long as it is possible to meet all of your project goals on time and within budget constraints. Look how many pro shops are failing to do that with C++. Not saying the language is the sole reason, but it is a big factor.
onfu
onfu
Thanks for replies, advice, etc...

Given me a lot to think about.

I guess I''ll take a good look at each and set a simple task..and see what grabs me more...

I think Java being slower would be a non-issue for me personally, since project #1 for me will not be doom 4. But I will still have to think about weather being in the Java minority will be too big a downside when trying to get into indie dev..

Anyway..much appreicated.
Thanks.
Captian Goatse
Captian Goatse
No it is not. I assume you have been to www.javagaming.org already or what is that shitty community process site now.

Java will be pretty good and switching to C++ is only matter of week. When I made up my mind whether or not Sun was a decent company I moved to C++ in few days.

To me Sun has been acting like a cry baby ever since they created JCP. Also a sore loser, that is.

If Java ever moves to standard body I will be happy to pick it up again.
Nekhmet
Nekhmet

I think that most experienced programmers can learn a new language in a day or two. You see, once you''ve experienced three or four languages, you realize that every language is just a slight variant of every other language.

I suspect that you will have to reach this level of expertise before you''re qualified to write a large game.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.