Appendix: Collected Rules

Each truth that I discovered became a rule that served me afterwards in the discovery of others.

René Descartes, Le Discours de la Méthode

Several chapters contain rules or guidelines that summarize a discussion. The rules are collected here for easy reference. Bear in mind that each was presented in a context that explains its purpose and applicability.

Style

Use descriptive names for globals, short names for locals.

Be consistent.

Use active names for functions.

Be accurate.

Indent to show structure.

Use the natural form for expressions.

Parenthesize to resolve ambiguity.

Break up complex expressions.

Be clear.

Be careful with side effects.

Use a consistent indentation and brace style.

Use idioms for consistency. ...

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.