Re:What science says about naming in programming
by tomatsu on Sunday January 08, 2017 @11:26AM
(#13350435)
I always go with plural for lists and singular for iteration variables.
[ Parent
| on HN ]
Re:What science says about naming in programming
by TeMPOraL on Sunday January 08, 2017 @12:46PM
(#13350897)
Personally I have a habit of avoiding that, especially in dynamic languages, because a single typo could have nasty consequences there. So I always figure out a synonym, or use a name for the variable that's either more descriptive:
for (let particularThing of things)
or at least visibly different: for (let th of thigns)
Re:What science says about naming in programming
by tomatsu on Monday January 09, 2017 @03:42AM
(#13354914)
The dynamic languages I primarily use are TypeScript and Dart. I always have enough type information floating around to catch this kind of thing. But even in JavaScript it wouldn't be much of an issue since it will instantly explode on the first run, which is certainly inconvenient, but nothing major.