3 ms·
I used to use i, j, and k; but at my last job single letter variables were frowned upon so I started using ii, jj, and kk and now much prefer those for simple l
by cpwright 5y ago
I used to use i, j, and k; but at my last job single letter variables were frowned upon so I started using ii, jj, and kk and now much prefer those for simple loops. Searching for "ii" yields the loop much more reliably and quickly than "i" which is often a partial match to other words.
- hangonhn 5y agoOh that’s clever. Thanks for that tip.
- Majromax 5y agoI developed the same habit after working on numerical code in Matlab. `i` can sometimes be sqrt(-1), but `ii` is always a variable. For greatest disambiguation, it's best practice to write `1i` for the complex number and leave `i` unused.