should < <= loop
if iterate by loop 7 times, use:
for (int i = 0; i < 7; i++)
or:
for (int i = 0; i <= 6; i++)
there twin considerations:
- performance
- readability
for opening i'm presumption java c#. does matter "less than" "less equal to" used? have understanding opposite language, greatfully infer which.
for readability i'm presumption 0-based arrays.
upd: plead 0-based arrays competence have confused things. i'm articulate iterating by array elements. only whole loop.
there good indicate next controlling consistent explain incantation array is. i "int number_of_things = 7" following "i <= number_of_things - 1" feeling weird, wouldn't it.
Comments
Post a Comment