Use MAJOR Comments to Summarize Blocks of Code [DS2] [WHAT]

Use MAJOR Comments to Summarize Blocks of Code [DS2] [WHAT]

Tip DS2

One of the first key ways to utilize MAJOR comments is to summarize a block of code. When multiple lines of code are adequately summarized by a MAJOR comment, readers can scan the MAJOR comments to get a mental model of what the the code is doing by reading less (fewer lines).

The following example for a number clamping routine shows how MAJOR comments can summarize different blocks of code:

Find the experts Ad.png