logoalt Hacker News

jayd16today at 4:26 PM1 replyview on HN

> That would make “ProductIndex” superior to “i”, which doesn't add any clarity.

Adds a ton of clarity, especially if you have a nested loop.


Replies

Groxxtoday at 4:38 PM

and god help you if those loops are pairing People and Products.

though now that I write that out... it would be really nice if you could optionally type iteration vars so they couldn't be used on other collections / as plain integers. I haven't seen any languages that do that though, aside from it being difficult to do by accident in proof-oriented languages.