Get Thinking
A detailed discussion of the following questions can be found in the "Appendix A" section on page 485.
Mull It Over
How might the need for and the content of comments differ in the following types of code:
Low-level assembly language (machine code)
Shell scripts
A single-file test harness
A large C/C++ project
You can run tools to calculate what percentage of your source code lines are comments. How useful are these tools? How accurate a measure is this of comment quality?
If you come across some incomprehensible code, which is the better way to factor in some intelligibility: adding comments to document what you think is going on, or renaming variables/functions/types with more descriptive names? Which approach will most likely be easier? ...
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