HTML and CSS Reference
In working environments, the maintenance of a program or script is often shared among
several individuals. The program you write today might be the responsibility of one of your
colleagues next month. Thus, an important goal in writing program code is to make it intel-
ligible to other users so that they can easily maintain and update it. Here are some tips to
• Use consistent variable names : One common source of error is misnamed variables.
You can avoid this problem by being consistent in the use of upper- and lowercase letters
in your variable names.
• Make the code easier to read with whitespace : Crowded commands and statements
are difficult to read and edit. Use whitespace and indented text generously to make your
code more legible to others.
• Keep your lines compact : Long text strings can wrap to new lines in your text editor,
making the text difficult to read. Strive to keep your lines to 80 characters or less. When
a statement doesn't fit on a single line, break it to a new line at a point that maximizes
Always comment your work, documenting the purpose of each variable.
automatically create your variables as soon as they are used in a statement, you should
still explicitly declare all of your variables at the top of your program.
As your scripts become longer and more complicated you can also simplify your code
more detail in the next session.
with objects, methods, and variables. In the next session you'll complete your program
to locate and fix errors that may appear in your code.