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():

Cross-Reference

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 ...

Get Code Complete, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.