Speccing Lists
I’ve commented a few times before about how difficult it is to test text manipulation code and most of that is caused by the fact that it’s so hard to comprehensively define all the possible states, user actions and resultant behaviors that are expected. There’s just way too many different cases that can occur (infinite in fact). The two hardest areas for most rich text editors are lists and tables (not surprisingly since their really the only complex structure used in text markup). In order to improve behavior in those areas and avoid any regressions we’ve started specing out the expected behavior.
No Wonder XML Databases Haven’t Taken Off
XML databases and the standards to work with them (primarily XUpdate and XQuery) are just plain crap. Why is it that I need to learn two completely different languages which utilize two completely different programming styles to work with a database? Why is it that I can’t seem to convert between a String and XML nodes in either of those languages? I mean, wouldn’t seem obvious that when working with an XML database someone might have some XML coming in as a parameter and want to deal with it as XML instead of as a String – say to put it into the database? Isn’t it obvious that someone might want to get a part of the XML file they’re processing using XSLT as a string instead of a node-set? I don’t mean get the text nodes within the XML fragment, I mean all the element declarations and namespaces etc, etc. Sure they’re more than just random text but if you wanted to output it so it could be edited it would be nice to be able to without jumping through hoops.
RSS Reader Feature Idea
It would be really nice to be able to subscribe to an RSS feed for a limited time. There’s two reasons for this. Firstly so that you can subscribe to the comments RSS feed for a particular article you won’t to track the discussion for but then have it drop out of your feeds once the conversation dies down (this might be best implemented as auto-unsubscribe after x days of inactivity).
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.