4 ms·
> I don't understand why 'i' has been given a pass. The reason is that in FORTRAN variables starting with i, j, k..n were defined as integers. Back in the day
by Gibbon1 11y ago
> I don't understand why 'i' has been given a pass.
The reason is that in FORTRAN variables starting with i, j, k..n were defined as integers.
Back in the day I learned fortran first, then basic. People that learned basic first often would use the letter 'a' as a loop index instead of 'i'
Now days I still use 'i' but often use indx instead because my editor doesn't highlight single letter variables easily.
- majewsky 11y agoI'm okay with "i" (like others said, it's a well-known shorthand for "iterator" or "index") but I often use "idx" because it can easily be combined with other words in nested loops (e.g. "rowIdx" and "columnIdx").