alan little’s weblog

AYAWT 0.1

10th September 2003 permanent link

Alan’s Weblog is now brought to you by version 0.1 of Alan’s Yet Another Weblog Tool (which needs a better name). It’s written in python using xml files as the data store (haven’t had the time or mental energy to return to the struggle to get the python-mysql connector to work on the Mac). I’m enjoying python, and I’m impressed that I’ve been able to produce a non-trivial working application in the course of three weeks’ train journeys to & from work - say about ten to fifteen hours work in total - using a language I had previously only played with for a few hours. (This also explains the long writing hiatus - I can spend my time on the train writing or coding, but not both.) If I’d used java I don’t think I would even had time to type the code in this amount of time, much less get it to compile and actually work.

There are still one or two quirks - the odd non-English character might come out looking a bit, well, odd. This is due to the standard python xml libraries choking on perfectly valid html-encoded characters even when clearly told that they are looking at an xhtml document. Haven’t had time to decide what to do about that yet.

UPDATE 4th October: it turned out that ’what to do about that’ was, change my default character set in BBEdit from ’Mac-Roman’ (whatever kind of quaint retro-look relic of the 20th century that might be) to ’utf-8’. Which was nice and easy - I thought I was going to have to write some kind of Tim Bray-style utf-to-html-and-back conversion routine.

It also occured to me that, for what version 0.1 does - basically, take bits of xml and stitch various permutations of them together to make xhtml pages - I hardly needed to use a programming language at all. I could have achieved the same effect with some combination of something like ant or make with a command-line xslt processor. (Or even ant or make without an xslt processor, just supposing I didn’t care about alienating readers who don’t have xslt-capable browsers). Of course, that approach might lack a bit in the scaleability department, wouldn’t be expandable to do all the marvellous and clever things my python program will (might) be expanded to do in the future, and would have involved spending my precious time learning xslt (not fun) instead of python (fun).

related entries: Programming

all text and images © 2003–2008