Chapter 4: The Write Stuff
Mull It Over
Grouping related code will make its relationships clear. How can we perform this grouping? Which methods document the relationships most strongly?
Obvious grouping devices are common name prefixes and suffixes; filesystem location; and putting items in the same class or structure, C++/C# namespace, Java package, source file, or code library. Can you think of more?
Relationships enforced by the language are the strongest—both obvious to read and also automatically checked for you. However, proximity of code layout is a more potent association than you’d think. Ordering also implies a lot—you’ll think that the first item is more important than subsequent items. Exploit these facts to document your code.
We should ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access