Hacker News new | ask | show | jobs
by SEJeff 1306 days ago
Yeah i for for loops (in python) x for comprehensions, etc, make sense. But in general, single character variables make code really hard to read.
1 comments

Yep, you should just use the best judgement, for example

    for distance, time in driving_metrics:
      speed = distance / time
is a lot clearer than

    for d, t in driving_metrics:
      s = d / t
even if it's used in a tiny scope once. But some things don't have a valuable meaning, or the meaning can trivially be inferred.
I meant i as in the iterator variable for a counter like when using enumerate() or a c style for loop where you manually specify the list index.