Monday 26 December 2011

Complicated? Why yes, yes it is...

Well after tinkering with Java for a little while I have come to somewhat of a conclusion. (This might seem a little premature, but hey, I'm not getting any younger..)

Unless you have been tutored professionally, or have bucketloads of time to throw at it, Java is one hell of a mind-boggling beast! I've done a fair bit of reading and my usual amount of tinkering and messing about (I've never known such an unforgiving language!) but it seems that you have to jump through hoops just to get even the most basic of tasks accomplished.

This gives me even more respect for people who code fluently in this language.

I have managed to open a window, and render some rudimentary graphics but they really are basic. And I do mean basic. I started with this...


...and after some messing around, managed to persuade it to evolve to this...


...but it was far, far from straightforward. I also found that unless you dig really deeply, a lot of the language syntax can be confusing. For example a loop will execute the first line if you don't encase it in braces (and the compiler won't notify you that you have omitted said braces). So when you add a second line to the loop, the whole thing throws a wobbly and returns some totally unrelated error message - both in NetBeans and Eclipse. 

Believe it or not, here is a snippet of code I wrote to create that second image above. (Yes, I realise it's called "zombies", there is a story behind that which isn't worth going into here)...


...confused? So was I. And a single upper case letter where a lower case one should have been and, well, let's just say it didn't like it much.

When I first decided to have a look at this language, I had the idea of making a (really) simple game, maybe in an Applet that could run in a web browser. As soon as I started reading about graphics animation, I pretty  much changed my mind there and then. I might give this another look after I've had some sleep, but I think I'll be jumping back aboard HMS DBPro, where I feel more at home and it doesn't take 20 lines of code to draw a pattern in a window.

I think I'll leave Java to the professionals. And the young people :)