Errors and documenting code

When programs are written, it is likely that at least some errors will creep in. Errors in programs are often referred to as bugs.

It is vital that programs are as free of errors as possible. Errors can cause a program to produce unexpected results, or crash.

There are two types of error that need to be considered:

Each type of error is different, and each is solved in different ways.

It is also good practice to document code. Documentation helps keep code easy to read and easy to understand.