Rewrite
I’ve been talking about rewriting the background code for this site for quite a while, although with a noticeable lack of activity. You may notice that the page generation time is now given at the bottom of each page. I hacked that in a couple of days ago to get some idea of the speed of the code. It seems to be around 40-70ms in most cases, but occasionally takes longer (probably due to load on the server from other websites). That’s not awfully fast, and it’s not surprising, because there are some fairly inefficient routines in the code. In particular, the automatic navigation generator isn’t pretty.
Although the code is quite well documented, it’s still ugly. Too many global variables, unnecessary interrelationships between functions, and so on. If I’m going to refactor anyway, I’m want to go object-oriented. Perl’s object syntax isn’t a pretty sight, so I’d like to do it in Ruby. Ruby doesn’t seem to be as fast as Perl, but there’s a lot to be said in favour of a well-written, efficient program in a slow language against a hack in a fast language. Otherwise, we’d be doing everything in raw assembly code! The main problem with using Ruby is that my ISP’s support for it is even less advanced than for Perl. Still, I ought to be able to compile anything I need, with luck.
I haven’t done a lot of work today, since I spent the afternoon and evening in Shinsaibashi. However, I’ve been able to find a very promising package for web page generation in Ruby in the form of Amrita. I’ve sketched out a basic design for the software tonight. I couldn’t have formulated the requirements or use cases without having this site already. I’ve identified a lot of weaknesses in my current approach.
I should be able to keep the URLs the same in most cases, or redirect them using RewriteRule when they aren’t, so that the bits that have been indexed by search engines still work. On a related point, I need to find a better method for archiving things like the diary: the page numbers are in constant flux, making links useless. I can’t even link to old entries on my own site!
I’m going to simplify the navigation, using a few categories rather than the fancy, sometimes confusing nested tree view I have at the moment. Instead, I’m going to rely on introducation pages for each section and subsection.
My multi-lingual approach is totally broken, too. I don’t have the time, energy or desire to translate everything, so the structure of subsidiary language pages should reflect that. A brief synopsis in Japanese will suffice, along with a guide to the sections that I have translated. My website will always be written primarily in my mother tongue, because that’s who I am.
I am also going to change the design. I’ve actually had a lot of positive comments about the present design, but it, too, has its flaws. It’s a bit wasteful of space. Besides, I’ve been exposed to it a lot—it’s beginning to look tired to me.
I’m not going to get a lot done tomorrow, but I’m hoping that I can get at least something in place by the end of the week. After that, I’ll be busy again!