G-4395: Avoid hard-coded upper or lower bound values with FOR loops.
Minor
Changeability, Maintainability
Reason
Your loop
statement uses a hard-coded value for either its upper or lower bounds. This creates a "weak link" in your program because it assumes that this value will never change. A better practice is to create a named constant (or function) and reference this named element instead of the hard-coded value.
Example (bad)
1 2 3 4 5 6 7 8 |
|
Example (good)
1 2 3 4 5 6 7 8 9 10 11 |
|