Chapter 26. Top-Down Design
As programs get larger and more complex, they become more difficult to design, code, and maintain. As with any large project, it is often a good idea to break large, complex tasks into a series of small, simple tasks.
Let’s imagine that we are trying to describe a common, everyday task—going to the market to buy food—to a person from Mars. We might describe the overall process as the following series of steps:
Get in car.
Drive to market.
Park car.
Enter market.
Purchase food.
Return to car.
Drive home.
Park car.
Enter house.
However, a person from Mars is likely to need more detail. We could further break down the subtask “Park car” into another series of steps.
Find parking space.
Drive car into space.
Turn off motor.
Set parking ...
Get The Linux Command Line 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.