I’ve come to really enjoy Java over the past few weeks. I recently discovered the Java Collections Framework (JCF)—
—and if you love Perl’s arrays and hashes (or Python’s lists and dictionaries) as much as I do, you’ll surely fall hard for the JCF like I did. One thing that I wish I realised earlier though: TreeSets can’t contain two items where item1.compareTo(item2) == 0, even if !item1.equals(item2). So watch out there or you’ll be chasing your tail for hours like I was.
I’ve also discovered that I really like Java GUI programming. Our Software Engineering 1B assignment requires us to code a decent batch of GUIs and custom controls:
It seems that GUIs can get much prettier and much more functional once you understand how to use GridBagLayouts; if you’re stuck doing Java GUIs then learning to use them is probably quite worth the effort. More functional? Yes indeed—a fully resizable dialogue is much more functional than one with a hard-coded size, and GridBagLayout seems to support this quite nicely.
I also finally sat down and worked out how to use Java’s serialisation. How I wish I took the time to do this earlier, especially before this semester started—coding your own data loading and saving routines is so mundane (and evidently completely unnecessary). Oh well.
Anyway, I’m now convinced that when I get around to working on some of the extracurricular projects that I have in mind (if ever), Java will be the perfect weapon of choice.