Use Minor Comments to Prepare Readers for Upcoming Code [DS9] [WHY]

Use Minor Comments to Prepare Readers for Upcoming Code [DS9] [WHY]

Tip DS9

MAJOR comments provide a high-level way to give reader a summary of a block of code, helping the reader be prepared for what is to come. But not everything can be concisely communicated in MAJOR comments, and in such cases, you can also use minor comments to better prepare readers for upcoming code.

The following code leverages a minor comment to explain to readers why a “current line” variable is declared before a loop and also prepares them for that that variable would be used later in the loop:

Insights from every commit ad.png