7 Java Irritants

Java is a pretty robust language for the objectives it seems to set itself - being a clean and easy-to-learn object-oriented language - although the slippery slope towards featuritis is very apparent in 5.0. The automatic garbage collection, in particular, is a godsend for someone migrating from C++.

But there are still plenty of little niggles that could be rectified:

  1. Make the structure of the program dependent on indentation, like Python, and get rid of the curly braces everywhere. It makes sense.

  2. Get rid of the primitive data types (int, long, etc.) at the source level. Auto-boxing in Java 5.0 makes them less annoying, but they still aren’t necessary - the lack of a primitive string datatype makes that clear.

  3. Have an explicit modifier for package-private/friendly visibility, for consistency, and make it mandatory to specify a visibility modifier. These things make the code less ambiguous for those unfamiliar with the rules.

  4. Remove the one-class-per-source-file restriction (in theory this is for public classes only, but because of this, most people use a separate file for each class). It makes for huge and unwieldy build and deployment structures. C++ shows how it can be done.

  5. Get rid of the syntatic inconsistency between interfaces and classes. Methods in interfaces are always abstract as they cannot have a body. Java allows the _abstract _modifier to be missed out, however. This can be confusing.

  6. Make /* */-style comments nestable. It is very irritating to comment out a block, but have to do it in bits because of a ‘real’ comment block that’s part of the code. Colour-coding text editors mean that there shouldn’t be any confusion when doing this. It would also make //-style comments largely redundant.

  7. Merge the concepts of list and arrays, as Perl does. This allows for a far greater degree of expression in the language, and reduces some of the OO waffle necessary in Java when dealing with lists.

This kind of stuff is almost always about personal preference, so it’s unlikely that you’ll agree with all of the above. But I’d love to hear your comments anyway. What little things annoy you about Java?

Menus Again: ProBlogger Compares Them to Blogging

In an attempt to lighten my mood from writing grumbles about big government and security, I notice that Darren Rowse at ProBlogger mentions that his local cafe has recently reinvigorated their menu, and seems to be finding more success as a result (he then creates a rather tenuous link to re-invigorating a blog by a similar method). Another vague data point for my menu study? Sadly, he doesn’t say exactly what they did to the menu to achieve this. Incidentally, ProBlogger is a meta-blog: blogging about blogging, particularly how to make money out of it professionally.

Virgin Rail Accepting Air Tickets

Whatever it’s possible to say about Virgin Trains’ unreliability and high prices, they have shown a lot of ingenuity today:

Virgin West Coast has said it will accept London to Manchester air tickets on its trains.’

Of course it is good of Virgin to do this - PR moves don’t have to be cynical. It’s also a clever attempt to persuade people that the train makes sense, though - especially for London to Manchester, where the benefit of flying has always been marginal anyway. As airline travel becomes even more awkward (even when today’s restrictions are relaxed - let’s hope they are soon), the train will become increasingly attractive. It’s a shame, because air travel could be so much friendlier if it were calibrated for a reasonable level of risk rather than zero tolerance. But that doesn’t seem realistic in the foreseeable future.

UK Air Travel Recreates 1984

The irony is that I was discussing Shaving and Carry-on not that long ago - it turned out then that I was being over-cautious - but it now seems I was being naïve. It turns out that the UK government thinks that we should be forbidden from carrying pretty much anything on planes because of a ‘critical’ threat (Bruce Schneier has written about the stupidity of these threat levels before). All I can say is, don’t believe everything you are told. When we can hold the government accountable because they actually give us some concrete information, that might change things, but I don’t think we should expect that any time soon. This is why I’m a libertarian.

Update 10:21: One of the links above goes to a downloadable copy of the BBC documentary ‘The Power of Nightmares’ on archive.org. It looks like the site is currently overloaded, but it’s well worth watching when it comes back online.

Update 13:59: The link now seems to be working again.

METRO-polis

As I wrote previously, I went to see the world premiere of METRO-polis in Leicester Square recently. Dave has now posted METRO-polis on Google Video. You can see his film from last year, Undo, as well (which is even better, in my humble opinion).

Can I have my fiver now, Dave? :)

subscribe via RSS