Why use ASP scripting?
As pointed out in other articles, scripting excels at doing repetitive things with a short bit of code. Let’s say you need a quick routine to churn out month names. We’ll use a built-in VBScript function to do most of the work.
That’s it. 3 lines of code with returns and code returns in place. Now that’s only 12 items. Imagine if you wanted to do this more than once – maybe a calendaring application. Well, put it inside yet another loop set for the number of iterations you might need. THAT is the power of scripting.
When to NOT use ASP scripting
|When it adds unneeded complexity. Write your code – be it HTML or scripting – to be as neat and clear as possible. If there’s a certain item that you will use more than once or twice, creating a routine is a very acceptable way to handle that need. If the item will only be used once, creating a routine to handle that one time action is overkill and is just one more routine to keep up.|
This is sort of the “don’t use a sledgehammer” concept. If it takes only a couple lines of regular HTML to express the needed content, there’s really no use using 15 lines of ASP script to do it!
|When your server is underpowered. If your site happens to reside on an overworked server or one that is really lacking in memory or processor speed, the parsing of the scripting can greatly chew up those resources. As the script starts allocation of variables, arrays, session values and the like, memory is set aside correspondingly. If your server is weak, this can GREATLY slow down the server and thus the site speed.|
|When your site is REALLY static. When creating a site, an evaluation of the site is important in determining if dynamic content is really going to be used. A good many sites out there just DON’T change that often and really do not NEED to be setup as an asp-centered page.|
If you really want to get slick on these kinds of pages… You can actually create the page as an ASP page, view the page in your browser, then upload that as HTML. Make sure your links reflect that the pages are the .html version of the page. Thus if you have some content that IS dynamic, but changes VERY infrequently, you can harness the power of your server (and scripting) to create the output and then be able to serve easily handled straight HTML pages to your visitors. When changes are again needed, just regenerate the ASP page and upload the HTML again. An example of the usage of ASP pages in this manner is explained in ADO tips. This will reduce the load on your server GREATLY.