🔒 Locked
Java as a serious game developing language.
Advertisement
Original Post
As far back as I can remember, people have been saying to avoid java like the plague, as far as development for games goes. I picked up a book anyways. I see some serious advantages that most people choose to overlook.
1) platform independence
2) major speed enhancements from older versions
3) forced OO design
4) automatic garbage collection (no delete or free)
5) language level multithreading (no forking or critical sections!)
6) language level socket support (kiss winsock goodbye!)
The only thing that prevents this is there is no hardware level bytecode interpreter. think of a processor that did bytecode instead of asm.
Just wishing...
Java is a serious programing language for game development, so is Python, C++ and ASM, and never is one language the best at all things.
Many times, development studios will write in multiple languages, you can write your low level engine code in C++/asm, and then logic code in Java. It''s been done more than you think.
Personally I love C++, but there are many places where Java is better for development.
Many times, development studios will write in multiple languages, you can write your low level engine code in C++/asm, and then logic code in Java. It''s been done more than you think.
Personally I love C++, but there are many places where Java is better for development.
The book I am using is the complete refrecne for Java 2 v1.4. It is really nice because it is written for people migrating from c++. Not that you would need to, but is there a way to use non-blocking sockets? Creating a new thread for each connection seems like it could really slow down a server with 20+ connections.
I really think that a Java procesor (JPU) could be implimented like a GPU, but again, I am just thinking.
I really think that a Java procesor (JPU) could be implimented like a GPU, but again, I am just thinking.
quote:
Original post by HaPpY
and most of what you listed is a disadvantage
Says the ignorant and un-educated.
John Carmack said he would have used Java for Quake III if he didn''t already have so much base code written in C.
First make it work, then make it fast. --Brian Kernighan
The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities. We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)
Do not interrupt your enemy when he is making a mistake. - Napolean Bonaparte
quote:
Original post by CaptainJesterquote:
Original post by HaPpY
and most of what you listed is a disadvantage
Says the ignorant and un-educated.
John Carmack said he would have used Java for Quake III if he didn''t already have so much base code written in C.
First make it work, then make it fast. --Brian Kernighan
The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities. We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)
Do not interrupt your enemy when he is making a mistake. - Napolean Bonaparte
as a scripting language smart guy, not for the engine
quote:
Original post by antareus
You speak of forced OO design as a good thing. Uh-huh. Take advocacy elsewhere, there''s already been at least 2 other Java threads going.
Mmm... Indeed.
I must say when (if ever) I make something worth destribution none of the positive features listed will include the word "force" in any form, anywhere. Maybe if I was listing the negative features, but thats not good advertising.
quote:
Original post by PnP Bios
As far back as I can remember, people have been saying to avoid java like the plague, as far as development for games goes. I picked up a book anyways. I see some serious advantages that most people choose to overlook.
3) forced OO design
4) automatic garbage collection (no delete or free)
IMO, these are disadvantages. Sometimes I don''t want OO and most of the time I don''t want automatic GC.
--
Dave Mikesell Software
my $0.02:
I like Java, mainly because it was the first language I really got into, and I know it the best. But I know it isn''t perfect.
I like Java, mainly because it was the first language I really got into, and I know it the best. But I know it isn''t perfect.
quote:
Original post by CaptainJesterquote:
Original post by HaPpY
and most of what you listed is a disadvantage
Says the ignorant and un-educated.
John Carmack said he would have used Java for Quake III if he didn''t already have so much base code written in C.
That reminds me of another advantage of C++. C++ integrates much more cleanly with C.
--
Dave Mikesell Software
You forgot
the lazy synchronization.
64 bit support.
Processor running bytecode would be as nice as processor running optimalised native code. JIT overhead isn''t too much noticable.
Bytecode isn''t perfect. Creation of bytecode processor would make you problems with bytecode level 2.
Re ataru.
Class encapsulation isn''t harmfull, you have the code on one place, and could work with it easily.
Nothing would stop you from non OO programming, except JIT dislikes too long, 1200 lines, methods. It might have problems with inlining.
Where is Lun?
the lazy synchronization.
64 bit support.
Processor running bytecode would be as nice as processor running optimalised native code. JIT overhead isn''t too much noticable.
Bytecode isn''t perfect. Creation of bytecode processor would make you problems with bytecode level 2.
Re ataru.
Class encapsulation isn''t harmfull, you have the code on one place, and could work with it easily.
Nothing would stop you from non OO programming, except JIT dislikes too long, 1200 lines, methods. It might have problems with inlining.
Where is Lun?
quote:
Original post by PnP Bios
1) platform independence
2) major speed enhancements from older versions
3) forced OO design
4) automatic garbage collection (no delete or free)
5) language level multithreading (no forking or critical sections!)
6) language level socket support (kiss winsock goodbye!)
1. ANSI/ISO conformant C++ is platform independant, for the most part. Use OpenGL/Glut and you have platform independant code with hardware accelerated graphics.
3. Forced OO design is by no means a good thing. Its my opinion that Java was designed by very intelligent people in order to be used by not so intelligent programmers, forcing certain paradigms is a great example of this. Bjarne Stroustrup recently gave a conference in my area on multi paradigm programming. "[Several programming] styles used in combination produce cleaner, more maintainable code than could have been done using a single style only.
4. Generally automatic garbage collection would not be that useful. For starters, this assumes you have an explicitly deterministic garbage collector - non-deterministic garbage collection that accept little more than ''hints'' ( such as Java has ) would be absolutely unacceptable in a game. You will also still be forced to write a heap/pool allocation scheme for your objects, again losing alot of the utility of a gc. Runtime allocation/deallocation of memory multiple times per frame is not common.
5. Multi threading opens up a whole new can of worms with potential for nondeterministic behavior among other things. Threads are also generally just an OS abstraction considering that most of all systems are still single processor. I don''t know of any relevant engine that makes real use of multiple threads, its just an unecessary abstraction that can often end up accomplishing little more than complicating your code. This is just my opinion though. Please share if you know of any engines that make relevant use of threading.
6. I don''t get what you''re saying here. Winsock ( among other interfaces ) are already extremely trivial to use.
The only thing I really agree with you on is the fact that Java has definitely become a bit faster compared to its old exclusively interpreted incarnations.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement