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

Sunday 18 December 2011

First steps...

I know it's only been a day or so, but I have taken some tentative first steps and I want to log them here :)

The first thing I had to decide on was which GUI (Graphical User Interface) Environment to use with my Java experiment. As I don't know the first thing about this language, I'm not really qualified to make an informed choice about this, so after a little sniffing around I found the two most popular front-end tools seem to be Eclipse and Netbeans.

This is Eclipse...


... and this is NetBeans...


I know they look very similar, and as far as I can tell they pretty much do the same thing, so for the moment I'm leaving them both installed, hoping that if I've made the "wrong" decision as to which platform to use, I can change my mind later. If it even works like that, who knows?

Anyway, having browsed around java.com for a while, it seems that NetBeans is the GUI of choice, so that's what I'll stick with for now. If you're interested, Eclipse can be grabbed from HERE and NetBeans from HERE .

I don't know if you noticed on those pictures (which you can click on to enlarge, by the way), but my first Java code is in there. A fully working program! I have got a handle on how the structure of the language works (sort of, it's early days) and it looks a bit daunting, but manageable. Anyway, here's the code...


... and here's the resulting output...


Awesome or what ?! Now it's time to do some research...

Friday 16 December 2011

Long time, no post :(

With the arrival of Battlefield 3 and a number of social events, it turns out that I have been neglecting my blog somewhat. However, with the excitement of BF3 dying down a little, and the upcoming potential free time due to Christmas holidays, I'm starting to get the creative itch again.

The EasyMatrix project is a fully working and usable application, and I do intend to use it at some point when I try and learn more about AI (Artificial Intelligence) programming, but at the moment I feel the urge to learn something new. I'm one of those people who can't stick with something for any length of time before being attracted to something new and shiny, but then I usually end up returning to the "old faithful" environments I'm comfy with.

I pretty much know my way around the DarkBasic language now, and finding solutions to programming problems is more a matter of "what to code" rather than "how to code it". If you're a programmer then that will make some kind of sense to you, I hope :)

So during the holidays I'm going to try and learn yet another programming language, namely Java. I have a few friends who already know Java reasonably well, and another couple of friends who have been meaning to take a look at it, but never got round to it. So I think I'm going to dip my toes in the water, and see what it's like. The only thing I do know for sure is that everything I need to learn the language is available for free online, so that's a huge plus in my book!

I'm going to try and keep this blog updated with my progress again, if only for historical reference so I can look back one day (while smoking my pipe and admiring my slippers) and think to myself - "remember when I tried to learn Java...."

It might turn out that after a bit of sniffing around, I decide that the language isn't for me, but right now my intentions are clear. I'll let you know how I get on.