Monday, February 27, 2006

Serialization considered harmful

The ability to serialize an object can be a very useful feature of a language or framework but there is a trap that developers often fall into when they first discover this functionality. Almost every app we ever work on requires some kind of file format to store information about the document the user is working on. So a developer will often think to themselves "This serialization stuff will save me heaps of time. I can serialize my object hierarchy with two lines of code when I need to save the document and deserialize it when I need to load the document". This way madness lies. Once you do this, your file format is completely dependent on the internal class structure. Want to change a property name or type? Bam, your file format is broken. Want to remove a property? Bam, your file format is broken. In fact, in .NET adding a new property will break your file format. Delphi is different in this respect since it will cope with adding new properties, but whether that is a good thing is open to question since it may tempt you into thinking this is a viable approach. A Delphi project I worked on used this approach for many years and it kind of worked, at the expense of being able to do any meaningful refactoring during the many years of its development. So if serialization is such a bad thing, why is it even in Delphi and .NET? Because it can be exceedingly useful. For instance, passing objects between processes, copying and pasting to the clipboard. Essentially, serialization is useful for short-lived operations. When things are written to file and we need to worry about backwards compatibility, serialization is not you friend.

Monday, February 20, 2006

Make your own radio station on the net

There are a couple of great sites that can help to find new music. First up there's Pandora that creates a radio station based on an artist or song name you choose. It works out songs based on the characteristics of that first choice, and can then be trained by giving the thumbs-up or down for particular tracks. The other site is This seems to use various methods to choose similar songs, like accepting cash from record companies (just like a proper radio station then). It also plugs into your media player of choice which is probably pretty handy, although I've not checked this out yet. It's also a bit more of a community since you can tag songs and join groups and all that kind of stuff.

Thursday, February 16, 2006

Search engines still have a lot to learn

I found out today an interesting little fact, Google (and other search engines I presume) are not omnipotent. There is a very simple way to trick it into rating pages higher than they should be. Just put some text in a noscript tag and Google will use the content in their indexing, but it isn't visible to browsers that have enabled Javascript which, let's face it, is most of them. So a dodgy website can use this technique to include references to a competitor and be in the listings when a web user does a search on their competitor's name. I can't say more than that since the specific example I'm aware of is currently in the hands of lawyers, but it will be interesting to see how it pans out. BMW in Germany were banned for a few days before Google re-included them in their index, so I'd like to see how a much smaller company (probably not paying Google any advertising fees) is treated. To see an example of this in action, take a look at, a page with an image and content in a noscript tag. Now do a search for Google noscript and see that the page has a pretty damn good ranking.

Friday, February 10, 2006

Have you heard of Windows XP?

Windows XP came out about five years ago, but looking at some of the software around you'd never have guessed it. Here's a dialog box from IE7, a pretty new application in anyone's book and yet it still has remnants of Windows 2000 even now. I'll let it off since it's still in beta but it's hardly the only example of the retro look. The depressing thing is it is so easy to make sure your application uses the correct XP controls. Just search for 'XP manifest' and all will be revealed. In the simplest implementation, your app doesn't even need to be recompiled and it will take about 5 minutes to get up and running. OK, a bit of testing will be required and those screenshots in the manual might need updating but it isn't a big job. So just do it. Not doing it suggests you haven't got the attention to detail required to write a decent Windows application.

Thursday, February 09, 2006

Google Sitemaps still smoking strange substances

So this week, Google Sitemaps tells me some of the best search terms to get to my site are "sex thixx game", "thixx game sex" and "thixx sex". I just wish it were true, I'm sure my hit count would be soaring... Saying that, my hit count has been soaring due to the film 'Doogal'. For some reason, the film of the drug-addled TV series 'Magic Roundabout' has been renamed for the American market. Not only has it been renamed after the main character Dougal but they've also changed the spelling of his name to Doogal. So I'm get lots of random people hitting my site. Unfortunately they aren't clicking on any of my ads, so I'm still not a millionaire...