Java. Really?

The Evolution of Computer Programming Languages
The Evolution of Computer Programming Languages (Photo credit: dullhunk)

I have become a victim of my own lack-of-ambition.

Having remarked, in my OS/2 article, on the continued lack of a decent hex editor, I thought, what-the-hell, it’s a double Bank Holiday weekend, why don’t I write one.

Except I thought about that a lot on Friday but didn’t write a line of code. On Saturday I decided I would definitely do it, but didn’t start until quite late. And then I decided I really wanted to watch The Battle Of The River Plate again (I don’t regret it, it’s a fantastic film), so did not do much coding.

But by then I had also made the really bad decision to do all this in Groovy (ie., a super-charged version of Java). I thought about using C or C++ but then, no, I wanted a piece of code I could move from platform to platform easily.

I thought it would be relatively simple. I had even written down some use cases and a simple idea of an MVC pattern to underpin it.

Since then I have struggled. Bad tutorials on the Oracle site that reference long dead features of the language were one issue, combined with Groovy’s (by design) ability to compile code that references functions not yet written was another (as badly specified functions can appear as odd run time exceptions). But the biggest flaw was Java’s fundamental lack of support for unsigned types. What A Joke!

How has this language survived when it insists of typing everything as signed?!

If I had written this in C or C++ I’d have the basic framework done by now, though admittedly the user interface parts would have been a lot more difficult.

For those who have similar problems – the answer is to use bigger types eg inside a Closure, I have this:
Long x = 0x00000000000000FF & it
numb = numb * 256 + x

– which ensures that it – an instance of Byte is read in as an unsigned number before being shunted on to the end of numb.