Programming for fun and profit
I work as a programmer. Most days it is great, because I get to spend my days writing software and even get payed to do it. However, when writing commercial software unfortunately the most elegant solution to a particular problem is rarely the one that is reasonable to spend time on. Almost all the time, "good enough" is the goal.
As an example, a new functionality that we have just added to voxbiblia.com, the website i spend most of my days working on is the ability to create albums out of the audio Bibles available from our site. An album is a collection of Bible verses read by one of our voices. From a more technical perspective a collection is a group of MP3 audio files. We want those MP3 files to be easy to download and once downloaded we want them to have metadata that makes them show up in your MP3 player. Do achieve this we want to be able to generate metadata information on the fly and we also want to put a whole lot of MP3 files with metadata into a zipfile so that i can be available as one download. We have code to to all this (The ID3 metadata generator will be released as Free Software some day, I promise) and it works as expected but one aspect of the zipfile generation code is not elegant as I would want it to be.
The current solution needs to read each MP3 file into memory to be able to calculate it's CRC-32 checksum before it can write it to the zip datastream served to the user. Since our server is quite powerful it is not a problem to read a few MP3 files into memory at the same time, but the thought that it must be a more elegant and efficient way of doing it was spinning around in my head. Since there is absolutely no justification for finding this solution, the one we had was good enough, I had to put this problem on the shelf for some time.
However, vacation came and when I thought about what to do that would be really fun and recreational I thought about this problem and I decided to try to solve it. So I did, and it was great fun. I will blog about the specifics of this little project in a short while, but for now I'm just so glad that I solved the problem.
Leave a Reply