28 November 2003
Not Invented Here (yet)
[Big Job ]Many Java vendors and developers seem slightly mystified as to why Java hasn't taken over the software landscape as completely as was originally promised and expected. They just can't understand why people are still writing and running various dialects of C and other platform-dependent languages - surely it's supposed to be "Run Anywhere, All Java, All The Time"?
However, it's pretty obvious to anyone who has actually had to use Java programs why they're not as popular as they might otherwise be.
The platform dependence of ol' fashioned binaries is an advantage as well as a disadvantage. Platforms usually include library management infrastructure; standard library sets, standard paths, built-in runtime paths that you an override, system-wide configuration tools and dynamic linkers. Therefore, when you type ./program, you don't need to worry about where the SSL libraries are or how to tell it to find libz. (I'm leaving out the arguments about DLL hell and why you can't install a GNOME application without installing a chain of six dependent libraries and updating a further ten.)
Java, being new and "platform-independent", does not yet have these facilities. There are competing implementations of some libraries, such as XML parsers - better make sure you have the right ones. There are no standard places to put them and nothing to manage them. These factors explain why packaged applications typically include copies of the required libraries, until your system is awash with multiple versions of the Xalan lib.
Worse, you have to explicitly tell Java where to find the required libraries (of classes) via the CLASSPATH environment variable or -classpath command line argument, because the application itself contains no clues. The elements in the class path can either be directories that contain expanded class hierarchies or JAR files, which are the same hierarchies archived into a ZIP file. (In fact, you can use ZIP files too; the JARs just have a couple of unnecessary housekeeping files added. You can even put the application classes in a JAR and use java -jar <jarfile> to run it.) Note that it can't include directories containing several JAR files, which would go some way towards obviating the imminent pain (whereas by analogy, the Unix dynamic linker library path lists only directories holding shared library archive files).
Hence for a Java application that uses several libraries, the class path will look something like:
/foo/bar/moo.jar:/burble/farble/wibble/oink.jar: /zip/pity/doo/dah/quack.jar:......and so on for lines and lines. By the way, make sure you get them in the right order. Anything less will produce the dreaded "ClassNotFound" exception (with no indication of which library the class is in). You could, of course, avoid all this by simply bundling the library classes in with the application ones (effectively a form of static linking, a concept that the serious Unix vendors have been trying to kill off for years), but that would be as crazy as bundling your own dedicated Java Runtime Environment...erm, oops.
And when you get that right, you also have to know - and type - the fully qualified name of the entry or initial class. That's "know", not "discover". C programs have these too, but they're always called main() by convention so the compiler automatically makes that the entry point.
Realising that most users rapidly grow tired of typing in lines like this and debugging class location errors, Java programmers usually supply a wrapper script or batch file to encapsulate the necessary environment settings and startup command. They have to write several such scripts, one for each platform that the "platform-independent" application will run on (oops). And unfortunately, in my experience, Java programmers suck at scripting. Perhaps they've been mollycoddled by all that Object Orientation. Abstracting duplicated data, particularly path prefixes, into variables is apparently an arcane mystery to them. Even passing through command line arguments is often too much effort (in fact, I've seen scripts that - after a tortured fashion - implement a fairly normal command line syntax and munge it into whatever bizarre form their Java app expects; why not just write the app to parse proper arguments in the first place, people?). Indentation and formatting? Forget it. (Well, you only need one level of indentation when you avoid the complicated stuff.) Process management? Wha'??
Finally, of course, you have to package all this crud up into some form that can be installed and managed as a single entity...erm nope, haven't quite cracked that one yet.
That's why your Java app is such a pain to start (and stop), let alone relocate. In fact, I've seen major name applications that are started by running a script in the background, after which it hangs around like an unwanted parent at a school disco.
Sun have recently attempted to alleviate some of this pain with a technology called WebStart, which offers online downloads and updates of packaged Java apps and their libraries. The programmer has to write the spec file for this packaging to describe the dependent libraries and Java versioning, which is at it should be. WebStart insists that all Java files are signed cryptographically - here's where it falls down, thanks to Java Man's disconnect with the real world. The key management tools are moderately easy to use (and to abuse when you're in a hurry and you don't have time for all this signing crap). Moderate because you have to sign everything in the package with the same key, once only. Mismatched or multiple certs will cause the install to fail. Probably wise, but rather annoying when the various JARs are coming from several different sources and may occasionally be updated. Never mind, the security this offers is laughable anyway...because when you enter your passphrase for the key, it appears on your terminal in clear text. Ten years of fighting bad password management and someone on the "cutting edge" makes a boneheaded, simple mistake like that!
...And you wonder why users seem to lack faith in Java applications. (Look! I wrote this article and didn't even mention the performance, the ugly GUI toolkits, the resource overhead and all the usual canards.)
21 November 2003
Orca performance graphing update
[Big Job ]If you set up Orca according to my original procedure and downloaded the orca_collect script, please fetch the updated script, which contains an important fix to prevent rsync copying all your data files on every run. Mea culpa for your lost CPU cycles.
20 November 2003
19 November 2003
Fallen leaf in b/w
[Big Picture ]Well, it fell...where I dropped it on the paving slab. An immensely simple idea that unfortunately still needs a little post-processing work.
11 November 2003
Hung out to dry
[Big Picture ]This shot is technically poor but (I think) aesthetically appealing, thanks to the always rewarding combination of a normal lens and XP2.
8 November 2003
Talyllyn from Cader Idris
[Big Picture ](Cader or Cadair? My old OS tourist map says the latter but everything else I've seen recently, including the NT signs, prefers the former.)
The summit was, as usual, covered in cloud and blowing a gale but on the way down the sun started to poke through across the landscape, highlighting a few features like the valley containing Talyllyn below.
6 November 2003
La Scar
[Big Words ]
This is "La Scala", the exciting new concept in contemporary outdoor, interactive sculpture (it says here) and the latest "enhancement" to the concrete wilderness of the plaza between library, arts centre & student union at Aberystwyth University. As you can see, it has been carefully designed to blend in, by means of the same bland grey concrete material as its surroundings, and yet also stand out, by means of its monolithic bulk and breathtaking ugliness. Apparently, it "unifies the open space and gives it a sense of drama"; isn't concrete marvellous?
I look at it and imagine an Aztec priest standing silhouetted at the top with his hand aloft, holding the still-pumping heart of the sculptor ripped fresh from his spasmodically jerking body by the sacrificial knife, as the chanting from the crowd below grows louder in homage to the rising sun behind. But that's probably just me.
This is also a demonstration of my new Canon PowerShot A40 digicam, of which more anon (also involves the heart being ripped out of things).
A beginning without end would be preferable
[Big Deal | Big Tangent ]Having endured Matrix Reloaded, I'm strongly less inclined to watch Matrix Revolutions. The fact that it features the Meringue-ian again, the comedy foreigner apparently modelled on Herr Flick ("of the Gestapo"), is already one strike against it. That it features Keanu Reeves and Carrie-Anne Moss, is directed by the Wachowskis and has the word "Matrix" in the title is several more, as I have now developed an abhorrence of all these things. But at least I have had some fun from the film already, without spending any money.
BB can exclusively reveal that plans are already in hand for a fourth movie, and this one will feature Andy & Larry Wachowski as the stars. They will be seen gathered around the master of the first movie with their flies undone, laughingly gushing fresh urine all over the reels while in the background can be heard Joel Silver snorting coke off Carrie-Anne Moss' ass crack as Keanu fellates him.*
...So basically a rehash of the second and third movies then. It's expected to be popular with the fans, mainly for the Moss scenes.
Just for shits 'n' giggles, here's a collection of MRev put-downs mostly culled from the relevant Slashdot thread. Not only did they give me a chuckle that I otherwise wouldn't have got from the most recent films, but I also discovered most of the plot and thus have the option of saving some precious seconds of this existence, real or not.
Proof that we do not live in the Matrix: In the Matrix, all three of the Matrix movies would have rocked. "Give us your opinion of the movie," they asked. I replied, "How about this, I give you the finger, and you give me my $9.75 back." > "You can't just review it. You have to realize... there is no movie." Yeah the reviewers are saying that too. > ... it ended up destroying all my faith in Hollywood You had what in what? "The Wachowski brothers have delivered a dud so disappointing, they may as well have bussed in Ewoks to save Zion" You mean it doesn't end with Keanu Reeves waking up, turning to Alex Winter and saying "Bill, I just had a most excellent dream!"? Shame. > Just got back from the 6:00am showing of the movie and I was pretty impressed. You probably fell asleep 20 minutes into it and dreamed a better movie. It's the only explanation.
* Some of these words are only here to pump up our Google hit rate.
![[Big Bubbles (no troubles)]](/images/bb-logo-main2.png)