3 ms·
Use 'j' and 'k', avoid 'i', especially for loop controls. It's so much easier to find their uses in the loop body with an editor, since they're high-valued Scr
by pklausler 10y ago
Use 'j' and 'k', avoid 'i', especially for loop controls. It's so much easier to find their uses in the loop body with an editor, since they're high-valued Scrabble letters and they don't show up in C++ reserved words apart from "break".
- nikanj 10y agoUse an IDE instead of an editor and finding/hilighting usages is just one keypress away. I'm often surprised how many people assume IDE=editor, but with higher system requirements.
- kazinator 10y agoIn Vim (editor, not IDE), if your cursor is on the i, then * will jump to the the next occurrence, # the previous one. In addition, they all get highlighted if ":set hls" (highlight search) is on, which is the default. "Don't use 'i' because it occurs often in keywords, making it hard to search for" is the most outlandish thing I've head in a good several weeks, even without the Scrabble reference.
- sullyj3 10y agoAlternatively, you could search for "int i" or "\<i\>", or "for (i".
- kazinator 10y agoMore importantly, don't use Notepad or Pico for writing code.