Why I hate XML, and Ant's use of it in particular

I was googling around for examples of how to sign a JAR file in Ant using the signjar task and came across this monstrosity - 217 lines of turgid XML. How anyone can say Ant is an improvement over make is a mystery to me, and how anyone could ever think that XML is fit for consumption by humans is an even bigger mystery. XML is food for machines, not people. I sincerely hope that the current fad for doing everything in XML (and we have some examples close to home) is going to an early grave.

What I'm actually trying to do is to deploy an application via WebStart from within NetBeans - I've loaded up the NetBeans WebStart module but it really doesn't cut the mustard yet, it doesn't support JAR signing, it hard-codes the name of the JNLP file and it assumes you want a WAR file building. Here's hoping they make the necessary improvements in short order.

Categories : Java, Tech

Language wars are so boring

I've just read James Gosling's post on how he got flamed for daring to say that scripting languages aren't a panacea. Whereas the old language crusades used to be fought between the various "compiled languages" it seems the new jihad is between "compiled" and "dynamic" languages. The arguments are much the same, and are just as tedious as they rely on religious fervour rather than pragmatism and common sense.

As James points out there's a huge continuum of both problem spaces and languages that can be used to address them, the trick is to pick the right tool for the job at hand. The point that most of the participants in language wars miss is that in most cases the choice of language should be secondary, the most important deciding factor should be what tools and libraries are available for the language and how closely they address the problem domain. Syntax just isn't that important - I care far less about having to declare types for my variables than I do about having to write a thousands of lines of code that could more properly be replaced with a library function. I also quite like having the dangerous and tedious bits of programming taken care of, such as memory management - an area where dynamic languages and garbage collecting languages such as Java have a clear edge over more traditional choices such as C - however in some circumstances C is still the right choice, when other factors (e.g. predictability or outright speed) are more important.

The day job for the last 18 months has been nearly 100% Perl and heavily regexp based as well as requiring access to MySQL, LDAP and a load of other network-based stuff. At one point I rewrote some of the Perl regexp code in Java. It was easy to do, thanks to Java's good regexp library. Sure it was a bit more wordy, but it worked just fine. That's the point - the power of both Perl an Java isn't really the core language, it's the ecosystem in which they exist - in Perl's case the unspoken hero is CPAN, in Java's case it's the extensive class library that it comes with, along with the vast range of freely available external class libraries. Choosing a language based purely on whether it is "static" or "dynamic" makes about as much sense as choosing a car based on the paint colour - sure it's important, but it's not the most important factor.

Tags : , , ,
Categories : Java, Tech, Perl

Tessa Jowell puts her foot in her mouth

Ms Tessa Jowell, the UK's "Culture Secretary" has recently been embroiled in a scandal in which her (now separated-from) husband David Mills received a £344,000 "present" from the less-than squeaky clean Prime Minister of Italy, Silvio Berlusconi for being "helpful" in a corruption court case that Berlusconi is implicated in. The money was subsequently used to pay off the Jowell's mortgage, and of course the fragrant Tessa didn't think to ask where the wedge had come from - I mean you wouldn't, would you?

Just to round things out nicely it appears that she has broken an ill-advised law that she herself was responsible for introducing. A while back had a new licensing and entertainment law passed, which in addition to making 24-hour binge drinking legal also changed the way licenses for public entertainment are granted. It's the entertainment part that she fell foul of. According to The Guardian:

The beleaguered culture secretary fell foul of regulations under the Licensing Act (2003) when she led an apparently innocent singsong to mark International Women's Day on March 8. ... Though the terms of the act require a licence for any musical performance in a Royal Park, Ms Jowell did not have one when she lead a rendition of The Truth Is Marching On in front of a statue of suffragette Emmeline Pankhurst in Victoria Tower Gardens Royal Park near the Houses of Parliament. ... Westminster city council's cabinet member for licensing, Audrey Lewis, confirmed that Ms Jowell and her fellow singers had breached the law, but said no prosecution was likely for this first offence.

This cretinous piece of legislation affects me personally as it means it is much more difficult to perform in public, either in a venue or busking, and it amuses me no end to see the person responsible fall foul of it. It amuses me even more to think that any member of the present Labour cabinet has the gall to sing "The Truth Is Marching On" in public. Hardly a week goes by without another revelation coming out about how they have their snouts in the trough. I thought the Conservatives were pretty bad at the end of their reign, but it seems that "New Labour" are hell-bent on outstripping them in the sleaze, cronyism and corruption stakes. I thought that there was sufficient evidence stacked up against them at the last election for them not to be re-elected, but I guess I'll have to wait until the next time round to see the back of them.

Categories : Personal