3 ms·
I think the real problem is the terse coding style. Why does the for loop always use "i"? When I write code, I don't use "i" or other single-letter variable na
by peterburkimsher 9y ago
I think the real problem is the terse coding style. Why does the for loop always use "i"?
When I write code, I don't use "i" or other single-letter variable names. I write long names, like "currentItem", "currentMessage", "currentUser", etc. If I reference an object, I usually name it "thisItem", "thisMessage", "thisUser".
Compilers shrink executables, so it's not a size issue. I don't know why people want code to be shorter; I prefer it to be easy to read and debug.
- mic47 9y agoNaming won't help, sooner or later someone will make similar mistake that will slip through code review. Real problem is that it is possible to accidentally do this type of mistakes. If you can avoid doing it by leveraging type system, you should. Relying on humans to never make mistake is futile.