Chapter 4: Interfaces

Before I built a wall I’d ask to knowWhat I was walling in or walling out,And to whom I was like to give offence.Something there is that doesn’t love a wall,That wants it down.

Robert Frost, Mending Wall

The essence of design is to balance competing goals and constraints. Although there may be many tradeoffs when one is writing a small self-contained system, the ramifications of particular choices remain within the system and affect only the individual programmer. But when code is to be used by others, decisions have wider repercussions.

Among the issues to be worked out in a design are

• Interfaces: what services and access are provided? The interface is in effect a contract between supplier and customer. The desire is ...

Get The Practice of Programming 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.