![]() tips menu | printable single page version Note: this is my old ASP tips page and is no longer supported. See the new Visualize web site..
Obviously, the structure of the script will vary slightly depending on the nature of the script, but this is a good general rule of thumb. All includes (containing useful routines and commonly used code) are marked clearly at the top, it's clear which variables are at script level, and the main processing is near the top, hence easy to find.
Note the symmetry in the code, i.e. create, open, process, then close and free up memory. By keeping symmetry like this, you won't go far wrong on performance and efficiency of server resources.
Finally, I tend to keep my HTML output routines totally separate from the main logic, usually via a display routine at the bottom of the page or in a separate include, thus keeping presentation separate from the business logic.
DISCLAIMER: Note these pages are a free resource for anyone wishing to reference them. Although every care is taken to ensure their correctness, the author takes no responsibility for any errors or problems that may occur through their use, or indeed misuse. These pages are copyight of Dave Clarke, Visualize Software Ltd 1997-2000 (all rights reserved).
© Copyright Dave Clarke, 1996-2008
|