Studies show that developers tend to make the same types of mistakes, no matter what language they are using or what program they are writing. The following table lists common problems that lead to bugs and suggestions for avoiding them.
Common Sources of Programming Errors
Problem | Suggestion for avoiding |
Wrong data type in a variable, such as expecting a text value from a property instead of a number. |
|
Not understanding what objects are available in a given context; for example, attempting to set properties for a Session object in a client script, or attempting to use the Internet Explorer object model in a script running on a different browser. |
|
Not understanding a function or procedure; calling the incorrect function. |
|
Incorrect arguments for functions; arguments passed in the wrong order; not understanding what values a function or procedure returns. |
|
Not understanding the meaning of a value, such as whether the values passed to a Move method represent pixels or another unit, or whether they are absolute or relative. |
|
Not understanding a data structure, such as the object model for a browser, or trivial misunderstandings such as assuming that an array index begins with 1 instead of 0 or vice-versa. |
|
Typographic errors, such as misspelling a variable name or keyword, or forgetting to close a bracket. |
|
Unexpected data, such as a user typing in a string when prompted for a number, or a number value outside the bounds of what the program can use. |
|
Not understanding language conventions, such as using the wrong type of quotation marks to enclose literals. This is an easy mistake to make when switching between languages such as between Visual Basic and SQL. |
|
© 1997 by Microsoft Corporation. All rights reserved.