Next tip...
If you give your variables names like
i,
j,
x1,
stuff, or
blah, you are using poorly named variables, I assure you!
Imagine reading through the code. You come across a statement like:
x1 = 5
Now what does that mean? x1 = 5? What is the coder trying to do?
(This is particularly embarassing when you are reading your own code sometime
later!)
First off, you should choose variable names that make sense. If the variable
is going to store the user's name, it should be named strName, not
a or something nondescriptive. Also, you should use prefixes to
convey the type of data you expect to be stored in these variables. Below is a
short table of prefixes commonly used for various types of variables. Since all
variables are variants in ASP, there is no formal or explicit type casting. (Although
you can use casting functions such as CInt(), CStr(), etc.)
| Prefix Notation |
| Integer | i |
| Long | lng |
| Single | sgl |
| Double | dbl |
| String | str |
| Boolean | bol |
| Object | obj |
I strongly suggest you adopt this naming convention, or use your own. Regardless
of the standard you choose, what is important is that you adhere to it! :) You'll
note that the majority of code snippets on the site that I have written use the
above prefix notation.