Re:Abandonware of the web: do you know that there is an HTML...
by alentred on Saturday November 01, 2025 @09:53AM
(#45781663)
My rule of thumb: only using single letter variables in one-liners (and never if it spills to another line), or for something that is conventionally represented as such. So for example:
or, using `x`, `n`, `s` and similar when they represent just that, a generic variable with a number, string, etc. I think there is a Code Complete chapter about it.
[ Parent
| on HN ]
Re:Abandonware of the web: do you know that there is an HTML...
by jazzypants on Saturday November 01, 2025 @10:16AM
(#45781811)
Yeah, I'm not GP, but my exceptions to this rule are `i` for "iterator" in `for` loops and `e` for "event" in event listeners.
Re:Abandonware of the web: do you know that there is an HTML...
by NetMageSCW on Saturday November 01, 2025 @01:35PM
(#45783558)
Don’t use ‘i’ (looks like 1), use ‘j1’, etc - helps set you up if you need a nested loop someday. Of course, at that point better naming would probably be best.