Regatta Fest

Tonight we went to go have drinks at The Regatta to catch up with Bender and Michelle. Of course a whole heap of other people tagged along, and it’s always a good occasion on a Friday seeing as premium beers are $3 each. It’s great going out and chilling with everyone again and then heading to the Hog’s Breath Cafe for a quick dinner. Leg’s still hurting a little, but I plan to be all good for the Big Day Out this Sunday. I’m not giving up another ticket… I even managed to catch a cab home for a measly $5!

All About Ant

I’ve always been frusted by the (lack of) information contained in Ant’s so called ‘Manual‘. Considering it has been around for so long, I have found it lacks the wisdom of best practices or tips for writing more maintainable scripts. I probably should have bought copies of Ant: The Definitive Guide and Java Development With Ant but I have never really needed it (and I was sure its contents must already exist on the web). Little did I realise that this page existed with more than enough of the sorts of information I wanted. Oh, and their wiki is well maintained too.

Elaborating on the Why, Not the What

Nat Pryce writes a good article about self-documenting code not necessarily being completely bare of comments, of which I am in total agreement of. Like many practices, developers tend to abuse the self-documenting code practice, suggesting that code should be stripped of all comments. Excessive amounts of comments are probably a good indicator of poorly written code, but some advocates forget that the premise of this practice is to get rid of as many redundant comments as possible, not necessarily all of them.

Applying the renaming suite of refactorings such as “Rename Method” can be used to get rid of ridiculous comments that describe what they do, like “This method returns a sum of numbers.” This can also be applied to all other items like classes, fields, constants, aspects and attributes.

This post started off as a comment for Nat’s entry, but I thought it would be useful to give more examples on why you might add comments.

Choices of Algorithms
Implementing some functionality normally requires some sort of trade off and these trade offs are sometimes important to document. Factors such as a framework, deployment or performance constraints might require some code to be written in a certain way, normally resulting in obfuscation. Communicating to other developers why this obfuscation exists can help because if that constraint goes away, then the code could be refactored without consequence.

Capturing Richer Domain Knowledge
Domain objects tend to be used at the core of a system, and I find, are usually the least documented. Well named attribute and class names can fundamentally describe what they represent, but may contain information or context for people new to the domain. For example, it took me a while on my current project to work out that the two terms our business analysts used actually referred to the same domain object. One was used when referring to it outside of the company context, the other used when dealing with it from inside. Especially when you are stuck with a domain model that cannot be changed it can be important to document things like differences between one attribute and another and the constraints some attributes may have.

Referencing User Requirements
Sometimes developers have to code a few things that don’t necessarily make a lot of sense on its own. Special cases mandated by users and captured by business analysts just must be completed. Fixes to bugs caused by incorrectly written user stories or overly complex domain models are another circumstance that may introduce code that, on its own, may not make a lot of sense. I find it has been useful, having done much maintenance programming lately, to add a reference to the issue that a block of code was added for. In the overly complex part of the system (caused because of the overly complex domain model that cannot be changed at the moment), the references to the Jira issues help to provide more context to the code that was added and why they are necessary.

Like all aspects of writing software, comments still requirement good judgement of how much business value they add. If you think it’s going to help someone else understand it, use it, or maintain it, perhaps its worth documenting. On the flip side, if you find existing documentation to be wrong, misleading or just a plain duplicate, then do the correct thing and remove it or fix it so it will not cause any further harm. On a final note, well written test cases can also be used to remove some classes of comments (those that describe business requirements or required functionality).

The Kua Curry

Kua Curry PasteThe Kua Curry
We had Gerrod and Kristy over for dinner late last year, who had just returned from their big honeymoon in Thailand. Amongst the many memories, photos and gifts that they brought home, they somehow managed to find something I would never have thought possible… a “Kua Curry Paste”, which they presented to me over dinner. After deciding to make a little bit of a special dinner last night with it, I of course, just had to blog about it.

You could be easily deceived by first impressions into thinking that this little packet contained yet another red curry paste, but the smell and taste produced by its special little mix of chillies and spices would convince you otherwise. The heat contained by the paste was the perfect amount, enough to start a bit of a sweat, but not the crazy tongue-numbing sensation that some curries carry. The trio of chicken, beef and prawns accompanied by the multitude of vegetables certainly made for one of my best home-made curries yet! Thanks again Gerrod and Kristy.

New RSS Feed

Thought I might create a new feed to better separate my technical (generally work-related) rants and then my every other day blog entries. The standard feed (wp-rss2.php), that this post should be a part of, will from here on contain only the technical ones. The feed containing all other categories is now available on (wp-rss2all.php). I’ve been posting a few too little geeky posts lately, so I thought it best to have a separate feed since I know one particular site uses the original feed.

TheKua Vs The Landcruiser

Update 10 Jan, 2005, 4:00pm AEST
I’ve decided to put up some pics of the injuries I sustained, but be warned that you probably really don’t want to look at them. At least they’re all a lot better than they were.

Update 9 Jan, 2005, 3:00pm AEST
I’m walking about pretty well now as the bruising is healing extremely fast (yay!). I managed to get some pictures of the damaged bike (linked some to the previous update) after visiting the bike store. Here’s the rest:

Update 1:27pm AEST
Thanks to the super efforts of Sister Suz and Brother Al, I was able to get all my X-Rays done this morning and there are no signs of broken or fractured bones. I’m certainly a lot more relieved to hear it, although I still cannot walk very well. I also called Lifecycle to find out how much damage there was to the bike. It was obvious to the guys in the store that I had been hit from the back after finding severe damage to the rear wheel, rear derailleur, rear brake, rear bike light and rear part of the frame. They don’t have my frame in stock, so they suggested the next model up which was specifically designed for triathletes (not that I am one, mind you), called Kona.

By the way I don’t have any fantastic injury pics to post because most of the external injuries have been relatively superficial, and all others are near things that should probably shouldn’t be shared with the world ;-). Thanks to everyone for all the support once again, and I hope to be back to normal sometime in the near future. I’m a little ticked off I’ve now had to give my Summerfieldayze ticket away for this Saturday!

Original Post
Hmmm… don’t you hate it when you wake up and feel like you’ve been hit by a car? Oh hang on a second, that’s exactly what happened to me yesterday. (more…)

Cache Me Not

Today I worked on an interesting bug that required us to forcefully push out a new copy of a file to any client that connected to our web application. The file was a javascript file containing several functions which are used by our application, one of which was modified and is now used as a trigger for an important part of the application (don’t ask why). Clients to our application are the general public, so forcefully clearing caches was certainly not an option, but our solution might have been made easier if we were allowed to change the name of the file, or even the name of the function. Unfortunately other existing technical requirements did not permit this.

A quick google-later gave me enough evidence that header tags like <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> (for HTTP 1.0), <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> (for HTTP 1.1), and <META HTTP-EQUIV="EXPIRES" CONTENT="0"> would not be enough to trigger a refresh of the client’s versions. Some sites described that writing out values in the HTTP-Headers might also work, but I wanted to avoid it for not being a very simple solution.

In the end, the solution we deemed acceptable was to simply add a query string to the end of the file so that clients would be tricked into thinking that it was a new file, turning something like: <script src="/scriptForRefresh.js" type="text/javascript"/> into: <script src="/scriptForRefresh.js?forceMeTo=refresh" type="text/javascript"/>

A New Year Day @ BBQ Breaks

Well I hope that everyone had a very good New Year’s Eve. Mine was a relatively quiet one, being a good time for reflections on the year just gone, contemplating both the good times and the not-so-great times had. New Year’s Day was spent attending BBQ Breaks held at Friday’s at Eagle Street Pier.

Yesterday’s perfect weather added to the fantastically charged atmosphere and the huge number of artists that played made it an awesome way to continue celebrating the New Year. Just a small sampler of those that played included: Kid Kenobi, Cut La Roc, Deadly Avenger, Kid Kay Ferris, Tipper, Tom Middleton, Soma Rosa and Ian Pooley.

« Previous Page