Main Content

A lazy programmer is a good programmer

Archive - Originally posted on "The Horse's Mouth" - 2006-09-15 09:18:57 - Graham Ellis

I'm lazy.

By which I mean, if a job can be done once in such a way that I don't have to keep doing it time and time again, then that's how I will try and do it, even if there's a bit more effort and cost at first. That's why (for example) we've laid an underground water pipe out to where we're planning to have a fountain at Well House Manor even though we know we could top up the water with buckets or hoses every couple of weeks.

And I'm a lazy programmer. Which means (I think) an efficient programmer. Always looking for ways to reuse code, and always looking for coding techniques which save effort at data entry and maintainance time. That last is all the more important, since data entry and maintainance is a huge task in most applications, outweighing the coding many times over.

We've been adding map references to our pages about the Melksham area for quite a while, with clever links to maps, etc. And we've also been adding a paragraph with words like "and nearby you'll find ...." onto most of the pages too - a bit of a maintainance hassle that as if I were to add - say - a page on West Woods and talk about Marlborough and Avebury, then I would also have needed to have visited those other pages and added references in the other direction too.

WIBNIF (Wouldn't it be nice if) I could just add a grid reference to a page and have it AUTOMATICALLY and dynamically add a list of nearby places? Well - I've invested the time and coding to do this. You can find my PHP source code here (and it's in functions so that you too can be lazy and just use my hard work!), and you can see it in action here where we list out over 50 places on our database near to Well House Manor Hotel.