5

Writing a Program

Programming is understanding.

– Kristen Nygaard

Writing a program involves gradually refining our ideas of what we want to do and how we want to express them. In this chapter and the next, we will develop a program from a first vague idea through stages of analysis, design, implementation, testing, redesign, and re-implementation. Our aim is to give you some idea of the kind of thinking that goes on when you develop a piece of code. In the process, we discuss program organization, user-defined types, and input processing.

§5.1 A problem

§5.2 Thinking about the problem

Stages of development; Strategy

§5.3 Back to the calculator!

First attempt; Tokens; Implementing tokens; Using tokens

§5.4 Back to the drawing board

Grammars ...

Get Programming: Principles and Practice Using C++, 3rd 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.