Pages

Sunday 5 August 2007

The Programmers Lament

You know the confident feeling when that task in front of you is clear, you can visualize the process from start to finish and you set about it, everything goes according to plan, nearing completion and you suddenly realize that what you thought you could do, you can’t! You start to hack it, modify it, shoe horn it until it works.

You reflect on what you’ve done and you realize you’ve made a complete mess of it. You wish that you could go back in time and tell yourself to sit down and plan out exactly what you are going to do before you start.

Well it’s too late this time, I have programmed myself into a corner, and it’s getting to the stage where I know that I will be better off starting from scratch. Not an easy decision after three days work!

So why am I writing this now? Well, basically it’s a note to myself, I will come and read this next time I start a project with the arrogant notion that I know how to do it without committing my ideas to paper first!

What I should have done.
Add the controls to a dummy form and make sure that they logically selected the conditions for each and every query the form was designed to produce.

Write each query out in full SQL, once everything is up and running correctly, then hack the SQL into nice tidy joined together string variables.

Send this monstrous ungainly form to the customer for approval before wasting days on making the code work clever!

Finally, before undertaking any task again, read this!