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.
Some other articles
M201 - Around Melksham, Wiltshire Pretty at the station too Seeing Christmas Coming to Melksham Around and about - Melksham Tell me a bit about Melksham After the storm My pictures of Melksham Carnival, 13th July 2013 Melksham - Flower Town New Pictures - Melksham Pack Horse Bridge Melksham welcomes visitors - new blue plaque trail and more Picture - between Lacock and Melksham Melksham Spa from Woolmore Farm Melksham Christmas Lights, 2012 Autumn scenes from Melksham How have Melksham shops changed in 60 years? Guest Guide for Well House Manor and Melksham Evening behind Melksham Spa Town Clean - Melksham Fine evening, country walk from Melksham - pictures Short Web Addresses for Melksham A walk around Melksham this morning. Can you place all of these? Melksham ATC - freedom of the town Some unpublished and historic pictures - Museum of Melksham The Bowerhill Villager - a newsletter for Bowerhill, Melksham A Museum for Melksham History. Open from 12th May 2012. Events in Melksham - read all about them, and tell us about yours Deeper than Art - An exhibition of the tattoo Canvas - Melksham Welcome to Melksham - our new communities Basham Festival, Melksham, early August 2012 - a welcome TrainWest 2012 - 14th and 15th April, Melksham, Wiltshire Along the brook - East Melksham to Melksham Exploring Melksham with a film maker The way of the Prioress - Melksham history pictured today Snow comes to Melksham, Wiltshire - pictures Images of the new year in Melksham Some different pictures from Melksham Melksham has a Heart - Montage picture for sale Melksham has a heart - come and see the pictures. Sunday, 11 to 3, Assembly Hall Quintessentially English - scenes from our Wiltshire town Melksham Forward - meeting summary and pictures Sunday Evening ... newest and oldest Melksham pictures Images of Melksham Currently pictured in Melksham Plenty to do in Melksham Home Grown Pigs, near Melksham Station Getting away from the madding crowd - an intercontinental journey Easter on the Canal - near Melksham, Wiltshire Morning in Melksham What have these pictures in common? Around and about Melksham in more pictures Her favourite store Seeing Electricity Pylons near Melksham Views of Melksham - November 2010 Autumn walk from Bowerhill Camilla, Duchess of Cornwall, turns first sod in Melksham Link Canal Melksham Food and Drink Fair and Town Crier Competition Dauncey Gardens, Melksham Melksham Scouts Melksham in Pictures The bull on the footpath New brochures for the Melksham area Early Spring walk in Melksham Freddies Wood and the K and A Canal Consultation in Melksham, on Melkshams future Melksham Christmas Lights Brown horses in Melksham Pantomimes around Melksham - 2009/2010 season Businesses effected by road works in Melksham Great to be in Melksham Standing on the corner, Melksham Carnival History is not always pretty Walks in and around Melksham, Wiltshire Melksham in pictures In honour of the photograph, I present ... a walk from Reybridge to Lacock Riverside Development Melksham Industrial East of Melksham Countryside Confidence, Customer Service and Tourism in Melksham The Month Ahead - What is happening in Melksham Walk to Bowerhill Going round the block Melksham Oak Community School, Melksham, Wiltshire More PHP sample and demonstration programs A little touring help during a business trip to England Getting the local voice heard Asda in Melksham - Welcome or not? Melksham Laundrette Moving to Melksham? Househunting map. While waiting for Melksham Post Office Till the cows come home Party in the Park Where and When - can you place the picture? Sorting out for a site map Wiltshire Circles Newport Male Voice Choir Melksham and Norwich Improving the historic town of Melksham Presenting Melksham - for a weekend away in Wiltshire Tuesday night is party night This article Image maps for navigation - a straightforward example Butterflies in a Wiltshire garden Melksham in Bloom Melksham Carnival Parade Melksham, Wiltshire Outside of the box H105 - Functions Coding efficiency - do not repeat yourself! Passing a variable number of parameters in to a function / method Improving your function calls (APIs) - General and PHP Adding extensions to PHP Open Source applications - callbacks Static variables and ampersands in PHP A variable number of arguments in a PHP function Global - Tcl, PHP, Python Static variables in PHP Clean my plate, but keep my wine bottle. (PHP; Static) is there a lookup function in php? Returning multiple values from a function (Perl, PHP, Python) A better alternative to cutting and pasting code PHP - static declaration Global, Superglobal, Session variables - scope and persistance in PHP This article Do not duplicate your code Don't repeat code - use loops or functions Functions and commands with dangerous names Code and code maintainance efficiency Passing information into and out of PHP functions Call by name v call by value There is a function in PHP to do that Variable Scope G100 - Introduction to Melksham River nearly bursting its banks in Melksham Melksham government and business organisations Repost - some useful pages on our site Around and about Melksham in more pictures A walk within without - Melksham Without Ten years in Melksham - looking forward to ten more. Great to be in Melksham A future vision for Melksham Moving to Melksham? Househunting map. This article Image maps for navigation - a straightforward example Melksham, Wiltshire An occasional chance, and reducing data to manageable levels More maps Why are we no. 404 Free parking for short errands in Melksham