News for hackers. Stuff that matters.
Re:Ask HN: What are your favorite developer-efficiency tips? by polm23 on Saturday May 09, 2020 @01:35AM (#23122564)
Don't use single-letter variable names like i, j, k. At least double them, like ii, jj, kk. If you do that then they're easy to grep for.
Re:Ask HN: What are your favorite developer-efficiency tips? by ribadeodev on Saturday May 09, 2020 @02:02AM (#23122660)
..or just do not use variable names smaller than 3 characters if they do not mean anything, period. There is no difference in coding time and no good reason whatsoever.
Re:Ask HN: What are your favorite developer-efficiency tips? by polm23 on Saturday May 09, 2020 @03:47AM (#23122991)
I generally agree, but I think ii, jj, kk are fine for those iterator ints in loops, or the throwaway var in a list comprehension in Python.

The only other situation single-letter variable names make any sense is if you have a short function that implements a mathematical formula, like distance or something.