I have become a victim of my own lack-of-ambition.
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
- Death by boilerplate: Iterating over lines in a file in Java (vs Scala, Ruby, Groovy) (thecodegeneral.wordpress.com)
- Getting the Spock out of a Gradle War (nofluffjuststuff.com)
- A Quick Introduction to the Groovy Language (Part 1) (java.sys-con.com)
- When technology grows up (pstehlik.com)
- Looking for GROOOVVVYYYY (astroneo.wordpress.com)
- TIOBE : C overtakes Java as the No.1 programming language (pixelstech.net)