Multiple Purpose Variable

This is a common mistake of beginner and experienced programmers alike to use one variable for multiple purposes, but the fact that experienced programmers might have a bad habit does not make it any less bad. Each variable in your script should have exactly one purpose. It may be tempting to just declare a couple of generic variables with fuzzy names, and then use them for multiple purposes throughout your script – but don’t do it! This is one of the best ways to introduce very strange, hard to track down bugs into your scripts. Giving a variable a good name that clearly defines its purpose will help prevent you from using it for multiple purposes.

First
Next