i've been browsing a bit trough the Wiki TDP posted, and i'm actually thinking java may be a good choice for us. why:
- it's easy to learn and to use:
// Compare
// In C++
int number = 411;
std::ostringstream mystream;
std::string mystring;
mystream << number;
mystring = mystream.str();
// In Java
int number = 411;
String mystring = String.valueOf(number);
- it will work on all java supported platforms
- today it's not all that slow, especially with JIT (just-in-time) compilation. around the time this project is done it will probably be even faster
- with upcoming OS's, managed code is going to be sort of the standard and unmanaged code will be managed anyway by the OS
- if speed is really a problem, it can call C++ bits
- the bottleneck will probably be the graphics anyway
- it has it's own 3D API, but if that's not good enough (I haven't really checked it) things like Irrlicht can also be used
http://gpwiki.org/index.php/Javaquote from "Killer Game Programming in Java" (
download):
One of my assumptions is that the reader (that's you) has had an introductory knowledge of Java, the sort of stuff gleaned from a semester's course at college. Near the start of that course, you were probably regaled with Java's many advantages: an object-oriented paradigm, cross-platform support, code reuse, ease of development, tool availability, reliability and stability, good documentation, support from Sun Microsystems, low development costs, the ability to use legacy code (e.g., C, C++), and increased programmer productivity.
Rather than explain each of these again, I will take a different approach and discuss Java's suitability for games programming in terms of the typical misconceptions and complaints wheeled out by people who think that games must be implemented in C, C++, assembler, or whatever (just so long as it's not Java).
Here's the list of objections to Java:
-Java is too slow for games programming.
-Java has memory leaks.
-Java is too high-level.
-Java application installation is a nightmare.
-Java isn't supported on games consoles.
-No one uses Java to write real games.
-Sun Microsystems isn't interested in supporting Java gaming.
It's worth saying that I think almost all of these objections are substantially wrong. Java is roughly the same speed as C++. Memory leaks can be avoided with good programming and techniques like profiling. Yes, Java is high-level, but it offers more direct access to graphics hardware and external devices. Installation isn't a nightmare if you use decent installation software. There's a growing number of excellent, fun Java games, and an enormous amount of support available from Sun and Sun-sponsored sites.
A general point about these objections is that they had more validity in the late 1990s when the language and its libraries were less sophisticated and slower. Java's user and developer communities are burgeoning and have produced a plethora of useful tools, online help, and code examples. The games forums dedicated to Java barely existed 2 to 3 years ago. Java is a great language for games programming, as I hope this book demonstrates. Now, back to the criticisms.