Beauty Is Only Skin Deep
A couple of people commented on my beautful code entry saying that the IDE should take care of code formatting and indentation and that ‘beautiful code’ is mostly about design. I’d have to disagree, beauty is only skin deep. The design of code doesn’t make it beautiful, it makes it maintainable – it makes it work.
You’ll have to excuse the inherent sexism in the following analogy – it happens to be the best one I can think of.
Object.equals(“Adrian Sutton”) == true
According to Google, I’m now the Object.equals() guy (for those who read via RSS only, I notice this because of the Google search that displays on the front page).
Beautiful Code Is Important
Any half-decent coder will agree that writing readable code is important and that good comments are a part of that. More and more I’m getting the impression that that’s not enough.
Code should be a thing of beauty. Not necessarily "oh that’s a beautiful algorithm" and definitely not "oh wow that’s clever" but beautifully laid out with every blank line considered for meaning and well thought out comments everywhere. Every construct and every line should match the selected coding style and real thought should be put into why that particular coding style was selected.
XML In Java In XML Is Ugly
I’ve been struggling with getting Cocoon and Exist to work together properly and allow me to insert an XML snippet into a document in the database. Apart from the fact that the apparent assumption seems to be that no one would ever have an XML snippet being fed into an XML-based system and thus all the < and > characters should be converted to entities, plus the fact that Exists seems to only want to retrieve stuff from the database and not change stuff in the database, I’ve wound up with the following:
So Much For Standards Compliant
Maybe I’m expecting too much but I would have thought that a browser that claimed to be standards compliant might actually implement the standard…. In particular I’m annoyed that Gecko doesn’t fully support HTML 4 tables (it ignores the align and valign attributes on colgroup and col elements). IE gets it right. To be fair, Safari also ignores them. Oh and of course you can’t achieve the same thing via CSS since CSS styles don’t get applied either via a styles attribute or via embedded styles (rightfully so since the standard doesn’t say they should be applied). You have to manually markup each cell in the column. Yuck..
Derby Is Cool
I thought it was worth mentioning that I got to play with Derby as part of the Time Tracker mini-project I mentioned earlier. Very cool. I’ve not had a need to work with an embedded database before so it was really nice to have a small, efficient library that handled all my data storage needs. The only complaint I’d have is that it needs to use a directory to store stuff in (it’s a little more flexible than that but a directory is always created and used). It would be really nice to be able to just point it at a file and say "that’s my database, do your thing".
JDIC
Java Desktop Integration Components (JDIC) is a set of components aimed at making OS specific functionality available to Java programs and to allow Java programs to make better use of existing code within the OS.
The tray icon integration is an excellent example of this. It’s quite common for a Windows application to make functionality available via a system tray icon and now via JDIC Java apps can do just that. During some down time after our last release I had a chance to play with this while developing an internal time tracking application and it worked out really well. The system tray icon acts as the main UI for the program so it’s neatly tucked out of the way so it doesn’t waste screen space but always quickly available so recording time spent on a task is highly efficient. The downside is that it doesn’t seem to map to an OS X dock icon menu yet (the API doesn’t really fit that model particularly well anyway but it could be done).
Why So Anti-Sun?
I really don’t understand why there’s so much anti-Sun sentiment around these days. I mean, the opensource movement in general just seems to have it in for Sun no matter what they announce or plan it’s either never good enough of there’s some sinister plan behind it. I don’t get it. Sun is one of very few big companies who are seriously weighing up the prospects of opensource and seem to generally be finding that opensource can work for them and moving in that direction. The opensource movement however, far from encouraging this is pulling out all stops in a smear campaign against Sun.
Make vs Ant
ONLamp.com has an article comparing alternatives to make (heavily biased towards make). In fact it only looks at ant and IDEs, I assume because it’s an extract from a book about make. It also focuses very heavily on Java development which is a real shame because Java development is the one area that make is almost never a good option.
The main reason that make isn’t a good option for Java despite it’s technical abilities is that every Java developer is expected to know at least a little about ant – a huge number won’t know anything about make and very few Java developers who work on Windows will have it installed. Every self-respecting Java developer will have ant installed and configured on their machines. It’s just the done thing when you work with Java. No self respecting C programmer would develop on a machine without make, no self-respecting Java programmer develops on a machine without ant.
Mustang Weekly Builds
It’s good to see Sun getting into the spirit of openness in the ways that really matter – weekly builds of the J2SE Mustang release will be available from now, including the source code (source Mark Reinhold). I’m not sure exactly what’s in the source code drops yet but even if the native code side of things isn’t included it’s still extremely useful. Most if not all of the people interested in fixing bugs in a Java release are Java programmers so they’re most likely to be submitting patches on the Java side of things anyway.
Glass Houses
Andy Lester asks Uncle Bill to answer some technical support queries for his family. Generally I agree with his sentiment but I have to pull him up on one thing:
At some point, we’ll get her HP laptop turned over to Linux, but until then, I have the weekly-or-so cussing from the dining room table.
and then later:
The bigger question for the industry: Why do we continue supporting a company that sees BSODs and registry hacks as part of normal computing life for the average user?
Because the alternative seems to be supporting a loosely coupled group of volunteers that sees competing GUI conventions and command line hacks as part of normal computing life for the average user.
SpamAssassin Is Losing The Battle For My Inbox
It seems more and more spam is getting past SpamAssassin and into my inbox these days. The upgrade to 3.0 hasn’t helped and may have even made it worse (or maybe the spam just got worse in the few days I took to get the database upgraded correctly etc). I’ve got the required score set down to 3 but there’s a bunch of spam coming through with a score of 2 while I do get random emails from people that score up to 2.5 and shouldn’t be considered spam.