You are previewing Code Complete, Second Edition.

Code Complete, Second Edition

Cover of Code Complete, Second Edition by Steve McConnell Published by Microsoft Press
O'Reilly logo

Constructing Routines by Using the PPP

This section describes the activities involved in constructing a routine, namely these:

  • Design the routine.

  • Code the routine.

  • Check the code.

  • Clean up loose ends.

  • Repeat as needed.

Design the Routine

Once you've identified a class's routines, the first step in constructing any of the class's more complicated routines is to design it. Suppose that you want to write a routine to output an error message depending on an error code, and suppose that you call the routine ReportErrorMessage(). Here's an informal spec for ReportErrorMessage():


For details on other aspects of design, see Chapter 5 through Chapter 8.

ReportErrorMessage() takes an error code as an input argument and outputs an error message corresponding ...

The best content for your career. Discover unlimited learning on demand for around $1/day.