Get Thinking

A detailed discussion of these questions can be found in the "Appendix A" section on page 480.

Mull It Over

  1. Grouping related code will make its relationships clear. How can we perform this grouping? Which methods document the relationships most strongly?

  2. We should avoid using magic numbers in our code. Is zero a magic number? What should you call a constant value representing zero?

  3. Self-documenting code makes good use of context to convey information. Show how you do this, and give an example of how a particular name would lead to a different interpretation in different functions?

  4. Is it realistic to expect a newcomer to pick up some self-documenting code and understand it totally?

  5. If code is truly self-documenting, how much other documentation ...

Get Code Craft 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.