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

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

using mvc, should hoop communication between views? between models?