The art of code
I’m going to run down a list of things that you should never do and things that you should definitely do when writing code for a website application. These are based on real-life examples… Needless to say. Never DO is often the result of other peoples code that I’ve had to clean up while Aways DO is just common sense!
Never DO:
Never create a form and leave fields open for users to type anything they want into them. Chances are very good that they will! Ever tried to clean up 200,000 bad database records?
Never create a web page that bulk emails 2000 people as soon as you load the page into a browser, with no warning or confirmation message and a cryptic result message such as “Done” when it runs, so that people who accidentally stumble upon your page have no clue that they’ve just spammed 2000 people! – That is, until AFTER the angry responses come in!
Always DO:
Always use a loop for everything you can to save time.
Always build an administrative page for every database/application to simplify management and editing of submitted data.
More to follow…