The objective of this chapter is to begin to learn to recognize and avoid different sorts of errors and pitfalls. Even experienced programmers seldom get programs to run correctly the first time. In computer jargon, an error in a program is called a bug. The process of detecting and correcting such errors is therefore called debugging. There are a number of different types of errors and pitfalls, some of which are peculiar to MATLAB, and some of which may occur when programming in any language. These are discussed briefly in this chapter.