▲ | Groxx 4 days ago | |||||||||||||||||||||||||||||||||||||
Obviously yes. They all routinely treat my "thingsByID" array like a dictionary - it's a compact array where ID = index though. They even screw that up inside the tiny function that populates it. If anything IMO, they over-value names immensely (which makes sense, given how they work, and how broadly consistent programmers are with naming). | ||||||||||||||||||||||||||||||||||||||
▲ | gnulinux 4 days ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||
Do you still have this problem if you add a comment before declaring the variable like "Note: thingsById is not a dictionary, it is an array. Each index of the array represents a blabla id that maps to a thing" In my experience they under overvalue var names, but they value comments even more. So I tend to calibrate these things with more detailed comments. | ||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||
▲ | partdavid 2 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
I get what you're saying, but what's interesting to me is that this case is a mild signal that a subsequent developer could take the same erroneous implication. "Id" does in fact imply to me that entries are indexed by "Id", i.e., an attribute of the item being indexed, and that they are not array-like, in that they wouldn't all get different IDs by a deletion, for example. | ||||||||||||||||||||||||||||||||||||||
▲ | DullPointer 4 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
Curious if you get better results with something like “thingsByIdx” or “thingsByIndex,” etc.? | ||||||||||||||||||||||||||||||||||||||
▲ | delifue 3 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||
Did you add the type annotation of it in code? | ||||||||||||||||||||||||||||||||||||||
|