Status Report 4: Recent Entries
Announcing a recent entries list and why this heralds many future improvements.
16th June 2004 · Last updated: 5th October 2016
I've updated the main page to show a list of recent entries.** (Can you guess what the three dots under each post name will be replaced by later on?) From now on, only the most recent post will be displayed in full. (Subject to change.)* Why this news is noteworthy is that the recent entries list also marks the debut of my beta database code. This will replace the current archives with a more intelligent system. When it's up and running, the new system will save huge amounts of bytes and hopefully be faster. But what's important is that it will also offer a Search form too. Rather than implement an existing one, tied down by the rules it comes with, not to mention possible adverts and all kinds of who-knows-what in the small print, with the "free" code likely to be replaced by a paid-for version any day, I've taken the step to code a search feature myself. That way I have complete control over what it can do, and can tweak it at a moment's notice.
I didn't realise though that it would be so much trouble to do. At the time of writing this, I still don't know if it will even work. (If not, well at least the archives will have been made more efficient.) I have firstly had to enter the details of 180 posts into a database. The details include some extras that a normal search form does not give you. (Stay tuned.) What is taking so long is that I keep scrapping the database format for a superior one. I think I'm on the fourth or fifth version of the data now, running off Access but saved as pure text. This way is the only way I can see to get the code as small as possible.) But oh, how Access gives me a headache! It's powerful - no doubt about it - but often annoying in the way it forces you to structure your data. Before that I was typing the text in by hand, leaving all sorts of redundant information in there to let me know what the data was. I wasn't using XML as that would have made the file size too big, so I devised my own format. But even that used too many bytes. Now each piece of data is separated by a single delimiter. Works wonders. I've used this format before at work to code a full database using PHP.
Sadly my PHP skills are slowing me down. I'm capable with it, but I always get something wrong. Simple loops turn out to be nightmare debugging sessions. Then I find I've typed a dollar symbol before an 'if' statement, so no wonder it wouldn't work! (Let's face it - PHP error messages are hardly helpful. I don't know what most of them mean.)
But I always get there in the end. My scripts might be nothing more than a post-BASIC mess of 'if' and 'while' loops, but they work. What I find over time is that I come across new commands in the online PHP manual, then go back and rewrite old scripts to be faster and more efficient. It's like coding HTML or CSS - you improve with time, get to know the shortcuts, learn new tricks.
So look out for a host of new and exciting things to come when and if I can get them working. Coding the search feature feels almost like programming a mini-Google in that I'm being forced to think of the most efficient ways to do searches, how data can be readily accessed and what will really speed it up. Naturally the ideas I've come up with will remain a technical secret, but I might reveal the gist of how they work. (That's if they work, remember.)
I hope all my hard work pays off. We'll have to wait and see.
*Update 19th June 2004: It will also make sense to show more than one post if several are published on the same day, or within days of each other.
**Update 14th December 2004: This relates to a previous version of the layout.