MarbleMice.com

Hacking the trees of knowledge.

Another Post About Java – Things That Annoy Me

without comments

I am afraid it it another post involving random thoughts about Java from a C++ programmer who gradually learning Java. NetBeans 6 Beta 2 is out, yay! I seemed to end up using NetBeans 6 rather than the more stable 5.5 mainly because the keyboard layout makes slightly more sense. Beta 2 release has a reduced number of bugs, which is a good thing. The official version 6 release is due this year – they may have to get into faster bug fixing mode to hit that deadline or push the release back. I am sure they would not intentionally ship a buggy version 6 and fix those in a 6.01 fairly soon afterwards :)

I guess I should not complain as I have not submitted any bug reports for the bugs I have found.

Ok, things that annoys me about Java.

  • No Operator overloading – Oh my god please put it in. Not being able to overload vector and matrix operations is bad enough, dropping down to y = x.add(z); is just ugly compared with y=x+z; I know it is a deliberate design decision – doesn’t mean I can’t complain about it.
  • Operator overloading again! Arrays use [] to access elements while ArrayList use .get() method. Flipping between the two is a right pain. Add a .get() access to the array or add operator overloading so you can use [] on arrays. Perhaps a specific refactor task could do it? I am still experimenting so am tending to flip types around a fair bit. Having to manually alter gets make the code less agile.
  • There was something else but I forget what it was – probably was not annoying me enough.

While looking around the Java game development landscape I took a brief look at the Slick2D library. It seems like a nice library that is gradually maturing. I pondered using it for a while but realised that for small games I would like to create the total size is just too big. It is built on top of LWJGL so before you start writing code you are up to a few meg of DLLs. Not really great for applets. If I was to do a larger scale 2D game for desktops I would certainly experiment some more with Slick2D. It is open source (BSB license) so I took a look through the code to get a feel for someone more experienced in Java lays out his code. Thankfully their code was not that different to mine.

Written by birdle

November 1st, 2007 at 10:01 pm

Posted in Programming

Leave a Reply