Sign in to follow this  
usxue

[java] I want to know how much advantage about game development in java!

Recommended Posts

usxue    122
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.

Share this post


Link to post
Share on other sites
lightbringer    1070
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 - everything is passed by reference.. no, wait..)
3) package namespace system makes dividing your work into modular components more intuitive
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)
5) faster object instantiation times, it's generally cheaper to create java objects than c++ objects (or so they say)
6) no legacy language (ie, C) to support = clearer OO
7) easier to learn and get started with
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)

Share this post


Link to post
Share on other sites
usxue    122
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 -
..................


First of all, thanks for your reply. Thanks very much!
I have some consideration about your reply:
You consider the advantage from the language.
I want to know the advantage of the game development.
For instance, some problems in the game developed in C/C++ can be solved in java. And I also want to know the problems in the game developed in C/C++.

Thanks very much! :)

Share this post


Link to post
Share on other sites
lightbringer    1070
I'm definitely not qualified to answer this question thoroughly, but I don't think there are as many differences as you think, with regards to game development. Both java and c++ are mature, object oriented languages, with a large standard library (java has the upper hand here - if you are starting from scratch and by yourself, you would definitely find the collections framework and the new concurrency utilities and the myriad of other java libraries to be helpful) and a wide possibility of applications. What kind of problems were you considering?

For instance, security considerations are mostly irrelevant - anyone who is determined enough will be able to decompile your product, regardless of whether it's obfuscated java object code or an executable compiled and linked with c++.

As mentioned before, the garbage collector does help with catching memory leaks which plague a lot of c++ games, but it can also be a bother - if you are creating too many objects per frame, the collector might slow down your program. Setting gc mode to incremental might alleviate the problem though, and I have no hard data on how many objects are "too many".

One thing that speaks strongly in favor of c++ is that a large number of game-specific libraries (for physics, networking, scene management, and collision detection) were written in c/c++. In comparison, java lacks such tools. We have some bindings for opengl, and a couple of scene graphs, and that's about it.

Share this post


Link to post
Share on other sites
wortel    174
I know Java and C++, and the difference isn't *that* big (compared to basic etc).

I like C++ more because it feels like I have more control over the pc, and it's easier to hack code :)). Also just the number&variety of libraries available are real nice.

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). 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).

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++.

Share this post


Link to post
Share on other sites
Simian Man    1022
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)

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:
Original post by lightbringer
2) no messing about with pointers (everything is passed by value.. no, wait - everything is passed by reference.. no, wait..)

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:
Original post by lightbringer
3) package namespace system makes dividing your work into modular components more intuitive

C++ namespaces do this as well.

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)

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:
Original post by lightbringer
5) faster object instantiation times, it's generally cheaper to create java objects than c++ objects (or so they say)

Yeah, I don't know where you got this idea, but it's not true. The time should be negligible in both, but if anything, C++ would be faster.

Quote:
Original post by lightbringer
6) no legacy language (ie, C) to support = clearer OO

Personally, I find the "Everything is an object" outlook very annoying, but this is a personal preference.

Quote:
Original post by lightbringer
7) easier to learn and get started with

This is a valid point.

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)

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).

Share this post


Link to post
Share on other sites
OrangyTang    1298
Everyone always forgets the fast turnaround time that Java gives you. <2 second compile times gives you lots of feedback when you're tweeking something or adding something in small pieces. Having to wait even a couple of minutes (and unless you're careful, it'll be much more than that) in C++ really interupts the flow and concentration.

Also, this has been answered in much detail about a bajillion times previously, have a search in the forum archives...

Share this post


Link to post
Share on other sites
Aldacron    4544
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.


I disagree that the library is a mess. It's very useful. And Java is always backwards compatible, which is why some people complain it is a mess. The library has improved with each iteration, with Sun recommending to use the improved features in place of the older ones. Some improvements come in the area of performance (such as ArrayLists to replace Vectors), where as others come in the form of new method calls to replace older, inconsistent ones. I don't know anyone who worries about which version of Java to code to. The only decision one need make about versions is whether or not to use the very latest (which takes time to propagate through the market), or the last version (which has already propagated).

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.


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.

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:
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)


This is such a myth. GCs, particularly in Java, have come a long way. You'll rarely find GC to be a problem even in games. If it is, it's most likely attributable to naive coding practices. Java has several tools to help with this, including different implementations of GCs to use. Besides, how many game developers implement their own custom memory managers, or smart pointer systems, to get a rudimentary GC going? Talk about saving development time.

Quote:
objects than c++ objects (or so they say)

Yeah, I don't know where you got this idea, but it's not true. The time should be negligible in both, but if anything, C++ would be faster.[/quote]

Memory allocation in garbage collected languages is almost always faster than in non-gced languages. Do some research via Google. This is one of the motivating factors behind garbage collection.

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).


Once the JRE is installed, Webstart is an easy distribution mechanism. The user always gets the most uptodate version of the app every time they run it. And it works across multiple platforms. Generally, the only thing you have to change for each platform is any native files you use - and it's easily configurable so that the user gets the appropriate files automatically.

Share this post


Link to post
Share on other sites
lightbringer    1070
Aldacron's already stated a lot of what I wanted to reply, in much more detail than I ever could, (un?)fortunately ^_^.

Still, to address Simian's points from my perspective:

1) I also strongly disagree, for the same reasons that Aldacron mentioned. From my limited experience, I've found the java libraries extremely helpful and easy to work with. They've signifficantly increased my productivity. Furthermore, they are more efficient than my own implementations (which you can take as a statement about my programming, or about the libraries - or both, if you prefer).

Actually, with an application like a game, particularly if it's large, the java version is a non-issue - the correct version of the private jre is simply bundled with the application. Public jre's do have an auto-update feature.

2) The problem is, of course, that greater control comes at greater responsibility. If every C++ programmer was forced to take a refresher on pointers and references every once in a while... ^_^. And of course, buffer overruns are another story that comes with this.

3) no argument here, particularly as I'm not familiar with C++ extensively (nowhere did I say that I am qualified to make an indepth comparison ^_^)

4) from various articles and reports the GC doesn't seem to be an issue anymore, but I'll take a raincheck until I am able to stress-test it.

5) I got this idea from an article published on JavaWorld, iirc. It stated that object allocation in java is cheaper than in C++, unless a finalizer is declared for the object. Sorry, no link.

6) As you say, this can be positive or negative depending on personal preference. Personally I like the pure OO approach more.

7) You say that like it's a bad thing! *grin*

8) Applets aren't useful for the kind of close-to-hardware programming I was inferring. As Aldacron stated, Webstart is an easy mechanism for distribution of smaller programs - and the user does not have to worry about installation, either. Also, all files are signed when distributed with webstart, so I can be assured that the content came from the author (trust issues aside, or else I'd be as scared to run the webstarted prog as your executable). Also, you will need to provide multiple versions of your executable for multiple platforms, if you chose to support any.

Share this post


Link to post
Share on other sites
Vexorian    152
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.


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:

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?



Sure Easier to read java binaries are far more secure than C++

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.

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++.

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:

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).

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.

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:

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).


Using a good library like wxwidgets for apps or SDL for games, you can make things portable to win32, mac or linux in C++ without any problem.

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++.

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.

---------

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.

----------
In conclusion both are good languages with pros and cons. I for some reason love C++ I think it is because I have the feeling it gives me more options than other languages, but everything depends on the programmer's style there is nothing wrong about JAVA for games but the lack of libraries

Share this post


Link to post
Share on other sites
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.


Asserts!

Share this post


Link to post
Share on other sites
lightbringer    1070
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.

You always know how arguments are passed in Java though. Primitive types are passed by value, and object references are passed by value (aka objects are passed by reference). It is somewhat less flexible, but it does mostly do away with having to think about pointers. Whether this is a "serious disadvantage" or not is really subjective. Home made safe pointers and memory management also mean more modules to debug when you could be writing AI code instead, and this part especially seems to be a constant source of bugs.

Quote:
Original post by Vexorian
Sure Easier to read java binaries are far more secure than C++

Any cracker with sufficient dedication and experience will be able to disassemble your binaries. That's a given, doesn't matter if it's java object code or c++ native code, obfuscated or compressed. But the security issue that was being addressed was not about how "secure" binaries are against decompiling - rather, it was about buffer overruns and such, and accessing memory that one is not supposed to access.

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.

I'm 99% sure that C++ was in fact not designed with games development in mind, either. What do you mean by console management? There is an ncurses implementation in java, if that's what you're after. If by "console" you mean something like the XBox or the PS2, then yes, Java has the clear disadvantage (for now at least).

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++.

Can't comment on this, but I would be interested in more detail or maybe some examples to illustrate more clearly what you mean.

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.

Because C++ is the de-facto standard of the games industry. I still have high hopes for the future of Java in this respect, though ^_^.

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.

Standard case of YMMV. I also feel more comfortable and productive (and fun) when coding in Java. But that's not an objective statement about Java. And if you get the same kind of feeling from C++, that's great.

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.

I think the point here was that if we assume ceteris paribus, Java will lend itself to cleaner code due to cleaner syntax overall (red warning neon light: subjective statement). Of course, it is no magic pill for bad coding practices. Also, what's wrong with System.out.println() (and what does it have to do with clean syntax)? Not that you'd ever really need to use that in a game of any kind of complexity, imho.

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.

Java does have multiple inheritance (interfaces), which one could argue is better than C++ multiple inheritance (such an argument would waste everyone's time). Not having operator overloading is an advantage in my book (again, we get into the realm of subjectivity).

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.

Exception handling is prevalent throughout all of Java, you can't shy away from it really. You're meant to use it. I would definitely not consider "getting console input" as a measurement for how easy it is to get started. What happened in your class was probably a mistake though, providing students with helper classes just postpones the issue of learning java i/o, which isn't all that complicated to begin with.

I think we've about exhausted all meaningful statements about the two languages though.

Share this post


Link to post
Share on other sites
Aldacron    4544
Quote:
Original post by load_bitmap_file
Asserts!


No doubt, asserts are useful for catching stuff. But the point is, it's the responsiblity of the programmer to put them in the code. And then they get compiled out when you build a version for release. And then there's the issue of when to use asserts and when to use regular if statements instead. I've seen a lot of code that used asserts where input was dynamic, a situation in which they are useless unless you leave them in for the release build.

Pointer management requires discipline and vigilance. No one is perfect. Errors slip through all the time because no one is perfect. By not having pointers, you eliminate a common source of bugs. And because the VM can track access to object references, you can get nice, informative dumps when you do make a silly mistake.

Share this post


Link to post
Share on other sites
Promit    13246
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.

They've actually sorted that little detail out now, so it's not such a bitch. Sure they're several years late, but better late than never, right?

As far as the memory management and GC. How things are passed is extremely well defined, and you can copy objects and all that if you want to. Lack of familiarity with the rules doesn't mean the rules aren't there. As for the GC, there are good and bad ways to utilize it. While I don't know the specifics of the java GC scheme (is a .NET style generational system common?), there are specific behavior patterns that will work well and ones that won't.

Share this post


Link to post
Share on other sites
Aldacron    4544
Quote:
Original post by Vexorian
No pointers or automatic pointers, means less flexibility to me, less flexibility seems to be a disadvantage,


To me it means safety. I've heard this argument about 'inflexibility' and 'lack of control' a million times. I just don't see it. When I program in C, I'm in C mode. When I program in Java, I'm in Java mode. You just can't program Java in C mode and I think that's where many of these strawman arguments come from.

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.


Total nonsense. The spec clearly defines that objects always have reference semantics. I don't know where you get this from.

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.


So how can having all of this done for you, behind the scenes, be a disadvantage? How long does it take to implement a solid, bug-free memory manager? This is one of the things I've never understood - how someone can say that the garbage collector and lack of pointers in Java are bad and then turn around and implement safe pointers and memory managers for their C++ projects.


Quote:
Sure Easier to read java binaries are far more secure than C++


Not file security, memory security. You aren't going to have buffer overruns in Java, or walk a pointer into undefined memory, or similar bugs.

Most security issues come from human error. Java eliminates many of the scenarios in which human error can cause security problems. It goes beyond that by automatically checking for common error cases and protecting you by throwing exceptions when they are detected.

Applications must be robust and secure when they are released. There are hundreds upon hundreds of examples out there of applications with security vulnerabilities. We know what the problems are, we know why they exist, and we know how to avoid them. Yet still people code software that have the same vulnerabilities again, and again, and again. Java and similar languages were designed from the beginning to minimize the risk of security vulnerabilities. They can never be eliminated completely, but Java goes a long way toward trying.

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.


The only language I know of that was intended for games is BlitzBasic.

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++.


Examples would be nice here, but it really doesn't matter. Trig functions are notoriously slow. IO can be a bitch at times. In the end it all evens out. Who cares how slow a particular method call is as long as you hit your performance target on your supported platforms? That's why we have profilers.

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.


No doubt, lots of game libraries exist for C++, now. Ten years ago they were rare beasts as most games were still coded in C. C++ was too slow for games, remember? There are a handful of Java game engines and other tools out there now. In 5 years time there will be more.

Java is surely not a panacea. There are several flaws with the language and the API. Any experienced Java programmer will happily bitch for an hour or two about them. But none of them are the problems often parroted by people who aren't experienced with the language. You have to walk a mile in another man's shoes to understand what he faces. Walking 500 feet tells you nothing. The same goes for programming languages. Until you've used one enough to really know what it's capable of and the real problems it has vs. the mythological ones, then any opinions you have are baseless and have no weight.

Share this post


Link to post
Share on other sites
Kevinator    229
I'm trying to figure out where these guys that say Java is so inflexible are coming from. Pointers merely provide an extra way to do the same thing. You can do everything in Java that you can in C, you just have to buck up and possibly lern a new concept or two.

Share this post


Link to post
Share on other sites
princec    312
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 :)

Share this post


Link to post
Share on other sites
Son of Cain    480
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 :)


You've said it all. Nothing to add, except a proof that Java (in this case, Swing) is a leading language in the overall market: here.

To resume, an excerpt: "Swing has become the dominant toolkit among North American developers (according Evans Data survey, go here for more). We are not talking about Swing being the dominant Java UI toolkit - no - it has become the dominant UI toolkit (period) - beating even Microsoft Winforms and Swing is continuing to grow at a phenomenal rate."

Share this post


Link to post
Share on other sites
swiftcoder    18432
First let me say that I like Java in general, although I don't use it that much at the moment.
But I find it hard to take seriously a Std Library whose LinkedList implementation has a random access interface:

LinkedList list = new LinkedList();

//...

for (i = 0; i < list.size(); i++)
Object o = list.get(i);

Just doesn't cut it. Obviously you are not intended to use this interface, but if so, then why is it there?

Share this post


Link to post
Share on other sites
Simian Man    1022
This thread has been pretty informative for me. It seems like Java has changed a lot since I learned it. It seems like Java even has templates now. Maybe it's time for me to give it another shot. Though I still think the standard library is unelegant compared to C++'s.

Share this post


Link to post
Share on other sites
Rattrap    3385
Quote:
Original post by Aldacron
Quote:
Original post by load_bitmap_file
Asserts!


No doubt, asserts are useful for catching stuff. But the point is, it's the responsiblity of the programmer to put them in the code.


The same arugement could be made about the NullPointerException. In C++ you need to catch it with an assert or an if statement. In Java you would need to use an if statement or catch the exception. It might not crash the program, but it is going to cause problems.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Quote:
Original post by swiftcoder
First let me say that I like Java in general, although I don't use it that much at the moment.
But I find it hard to take seriously a Std Library whose LinkedList implementation has a random access interface:

LinkedList list = new LinkedList();

//...

for (i = 0; i < list.size(); i++)
Object o = list.get(i);

Just doesn't cut it. Obviously you are not intended to use this interface, but if so, then why is it there?



Object randomElement(Collection c)
{
return c.get((int)(Math.random() * c.size()));
}


This function does not care what type of collection you use. If you pass it a vector, it will have O(1) worse case run-time (the same amount of time every call), if you pass it a linked list it will have O(n) worse case run-time (time will increase linearly with list size). Vector would obviously be a better choice to use if you use this method a lot, but the whole point of polymorphism is that the method doesn't care. If linked list didn't have this method, you wouldn't be able to use the above function with it.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
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


http://www.java.com:80/en/download/manual.jsp

A one-off 16Mb download for java is hardly enormous.

http://www.microsoft.com/downloads/details.aspx?FamilyId=0A9B6820-BFBB-4799-9908-D418CDEAC197&displaylang=en

A maximum of 166Mb for DirectX certainly is however.



Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this