Re:AI to name your Java Classes
by manmal on Sunday March 05, 2023 @11:47AM
(#35031275)
Why would it be such a good idea to obfuscate the semantics of three different loops (i,j,k) instead of writing “userIndex”, “addressIndex”, and “charIndex”? With “j”, I have to lookup its meaning constantly. If I need to scroll to understand the meaning of a variable, then there is room for improvement in my opinion.
[ Parent
| on HN ]
Re:AI to name your Java Classes
by MikeTheGreat on Sunday March 05, 2023 @12:08PM
(#35031526)
You're right that they're terrible names, and that giving them names that describe how the counter is being used would be better
and
Since they get used as loop counters so much you at least know that they're being used in a loop. It's not much info, but at least it's something. (The grandparent's suggestion of 'a, c, w' (or whatever) tells me _nothing_ :) )