Skip to content

Comment on How to Write Unmaintainable Code – Namingparent

Comments

If you have to search for loop index variable, your code has worse problems than naming.

I mean - I don't recall writing a loop longer than 2 screens in years. Usually a loop is less than half a screen long.

And anyway, you can search for [^\w]i[^\w] if you really need to.

Maybe it's aquired taste, but in array-heavy code (usually math-related) I much prefer A[i][j][k] * B[j][k][i] than the same with long names for index variables.

or \bi\b

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.