this post was submitted on 09 Jul 2023
592 points (94.4% liked)

Programmer Humor

32410 readers
1 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] atimholt@lemmy.world 7 points 2 years ago (2 children)

I like range-based for loops. You can just name the iterator after the object that it actually is. Have to be a little careful though, if the container is named a plural noun, and the natural name is the same word minus the easy-to-miss 's'.

This is one of the few things I really like about JS/TS. for (thing of things) is very legible and self documenting.

load more comments (1 replies)