October 2004
Intermediate to advanced
240 pages
6h 22m
English
Focus on one thing at a time: Prefer to give each entity (variable, class, function, namespace, module, library) one well-defined responsibility. As an entity grows, its scope of responsibility naturally increases, but its responsibility should not diverge.
A good business idea, they say, can be explained in one sentence. Similarly, each program entity should have one clear purpose.
An entity with several disparate purposes is generally disproportionately harder to use, because it carries more than the sum of the intellectual overhead, complexity, and bugs of its parts. Such an entity is larger (often without good reason) and harder to use and reuse. Also, such an entity often ...
Read now
Unlock full access