Original Post
I want to develop game in java but I must know how much advantage about game development in java! The game is PC game not j2me.
Quote:
Original post by lightbringer
What do you consider an advantage? And what kind of game is it? 2d? 3d? text?
Probably subjective, but what I'd consider some advantages are:
1) faster development time due to somewhat clearer syntax, an easily available and very extensive standard library (but this is true for c++ also, to some extent)
2) no messing about with pointers (everything is passed by value.. no, wait -
..................
Quote:
Original post by lightbringer
1) faster development time due to somewhat clearer syntax, an easily available and very extensive standard library (but this is true for c++ also, to some extent)
Quote:
Original post by lightbringer
2) no messing about with pointers (everything is passed by value.. no, wait - everything is passed by reference.. no, wait..)
Quote:
Original post by lightbringer
3) package namespace system makes dividing your work into modular components more intuitive
Quote:
Original post by lightbringer
4) automatic garbage collection (but for some games this might be a bad thing - and you still need to take care of other types of garbage)
Quote:
Original post by lightbringer
5) faster object instantiation times, it's generally cheaper to create java objects than c++ objects (or so they say)
Quote:
Original post by lightbringer
6) no legacy language (ie, C) to support = clearer OO
Quote:
Original post by lightbringer
7) easier to learn and get started with
Quote:
Original post by lightbringer
8) easier web distribution (or not. Webstart is annoying, and otherwise you're restricting yourself to people who have or are willing to download the jre)
Quote:
Original post by Simian Man
The Java standard library is a mess. It looks like everyone at Sun worked on different parts and then they tried to throw it all together at the end. Also stuff gets changed with each version. In C++ you don't have to worry about which version of the language/API you have; if it compiles, you're good to go. With Java, you have to worry about which version of Java you are coding in and which your users will have.
Quote:
In C++, parameters are passed exactly as the programmer says they are. I don't see the problem with this. I thought no pointers was an advantage to Java until I got NullPointerExceptions. It's really not much better.
Quote:
This is a benefit when working on most types of software. On games, however, the gc will give you noticable performance hits. (I know there are ways to get around this, but you would be better off in a non-garbage collected language)
Quote:
objects than c++ objects (or so they say)
Quote:
Unless you are talking about applets, I don't see what you mean. I can put a C++ program on the web, and anybody can download and run it without problems (assuming they have the same OS).
Quote:
In C++ is there isn't any protection from crashing the program on accessing a null pointer. And when you do get that sort of crash it can sometimes be difficult to find - particularly when they happen in the wild on not on your dev machines. NullPointerExceptions are not crashes, and they come with a detailed stack trace to help you pinpoint the exact location, even when they happen in the wild (unless you strip that info out of the class files). My current project is in C, a language with which I have a lot of experience. I know better, yet I still find myself hunting fixing crashes caused from null pointers more often than I would like. In Java, I almost never do. Seems benefit enough to me.
Quote:
But even more importantly is that you don't have the security problems pointers bring to the table. How many times have you seen pointer-related security alerts for apps & libraries? And yes, even games (Unreal Tournament comes to mind). This is particularly important in networked games. Pointers are inherently unsafe and humans make mistakes. Java greatly reduces the chance that those mistakes will happen. Many companies implement their own schemes to prevent them anyway (such as detecting array bounds errors during development, but then they go and turn it off on release where they need it the most!). Safety and reduced development time aren't benefits?
Quote:
However IMO coding java is more fun, it's cleaner, and goes faster (I also felt it was easier to debug, although this is quite dependant on what IDE etc you use).
Quote:
What i hate about java is that it's such a mission to get people to play your games, however, a game of mine ran absolutely fine on a mac (without me ever testing it on one!) which is not quite possible with c++. (Said game didn't run at all on linux, tho).
Quote:
Basically, if you feel like making a small 2D game just for fun, I'd go with Java. If you want to make a bigger, distributable, possibly 3D game, I'd go with c++.
Quote:
Original post by Aldacron
In C++ is there isn't any protection from crashing the program on accessing a null pointer. And when you do get that sort of crash it can sometimes be difficult to find - particularly when they happen in the wild on not on your dev machines. NullPointerExceptions are not crashes, and they come with a detailed stack trace to help you pinpoint the exact location, even when they happen in the wild (unless you strip that info out of the class files). My current project is in C, a language with which I have a lot of experience. I know better, yet I still find myself hunting fixing crashes caused from null pointers more often than I would like. In Java, I almost never do. Seems benefit enough to me.
Quote:
Original post by Vexorian
No pointers or automatic pointers, means less flexibility to me, less flexibility seems to be a disadvantage, an actual serious disadvantage cause you don't really have control on how are objects managed if their value will be copied or if they will use a refference.
In C++ you can even make your own memory manager, and many game engines do so and have their home made safe pointers and memory management.
Quote:
Original post by Vexorian
Sure Easier to read java binaries are far more secure than C++
Quote:
Original post by Vexorian
The serious disadvantage is that JAVA was not intended for games, and it is pretty clear, on c++ you could even make a game where the console formed the graphics, JAVA lacks support for the console's management.
Quote:
Original post by Vexorian
Also some operations in JAVA seem to be slower than they should be, it is too easy to overflow the stack with some recursive functions that take less than miliseconds in C++.
Quote:
Original post by Vexorian
And when you compare the quantity of libraries for games C++ has over JAVA , well it makes you forget any advantage JAVA brings to you.
Quote:
Original post by Vexorian
I don't really get too much fun from coding JAVA, I think that the fun you take when coding is not more than your own opinion.
Quote:
Original post by Vexorian
Cleaner? How clean code is seriously depends on the programmer, I've seen clean C++ snippeds and messy JAVA code, I don't think it really has anything to do with it. As a matter of opinion I think that the over-organization actually prevents code from being clean. For God's When you are making a console app, typing System.out.println() everytime seems problematic against a single printf, std::cout or cout if you use the 'using' keyword.
Quote:
Original post by Vexorian
I am making a 2d for fun in C++ and never felt better on any other language. Geez you can't have multiple inheritance in JAVA nor templates, nor operator overloading.
Quote:
Original post by Vexorian
Is JAVA easier to start? how do you actually get input from a console in JAVA? you would need your teacher to make a helper class for you like what happened with me at college. Or you end up having to code yours with the whole exception handling and things like parsing data types.
Quote:
Original post by load_bitmap_file
Asserts!
Quote:
Original post by Vexorian
Is JAVA easier to start? how do you actually get input from a console in JAVA? you would need your teacher to make a helper class for you like what happened with me at college. Or you end up having to code yours with the whole exception handling and things like parsing data types.
Quote:
Original post by Vexorian
No pointers or automatic pointers, means less flexibility to me, less flexibility seems to be a disadvantage,
Quote:
Java an actual serious disadvantage cause you don't really have control on how are objects managed if their value will be copied or if they will use a refference.
Quote:
In C++ you can even make your own memory manager, and many game engines do so and have their home made safe pointers and memory management.
Quote:
Sure Easier to read java binaries are far more secure than C++
Quote:
The serious disadvantage is that JAVA was not intended for games, and it is pretty clear, on c++ you could even make a game where the console formed the graphics, JAVA lacks support for the console's management.
Quote:
Also some operations in JAVA seem to be slower than they should be, it is too easy to overflow the stack with some recursive functions that take less than miliseconds in C++.
Quote:
And when you compare the quantity of libraries for games C++ has over JAVA , well it makes you forget any advantage JAVA brings to you.
Quote:
Original post by princec
December 2005 and still I see the same fecking arguments from the same sorts of people that still don't really know their arses from their elbows. No wonder I gave up Java evangelism :) Let people figure it out in their own time.
The only real issues with Java these days are:
1. its sheer redistributable size, which is enormous
2. if you want to do a DirectX only game, there's no binding for it
3. it won't run on any consoles
4. it won't get you a job at a games company
But if you're still so uninformed as to think that garbage collection is slow, or C++ mallocs are safer/faster/more flexible than the Java heap, or that multiple inheritance is essential, or that pointers cost you flexibility, or that Java takes more memory or is slower for most things, then ... I think it's time you spent some time actually learning about how to do it right, because you're probably going to have to get a job when you finish school / burn out from the shit games industry, and if you want a job these days in programming, you need to know how to cut Java code that works fast.
Cas :)
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more