Skip to main content
1 of 3
Rook
  • 20k
  • 9
  • 56
  • 96

This really depends on the situation/context (and there is no one fits all solution).

In general i,j,k [btw, i can be taken as index; its usage comes from mathematical background where those were most often the first three indexes (remember tensor calculus). It may also be connected to Fortran's history, where i being the first implicitly typed integer, was often used as an index of a loop. ] are often used if it is a simple counter. If it has a specific meaning, like month or year then longer variable name is better.

Rook
  • 20k
  • 9
  • 56
  • 96