4 ms·
This. So much this. There are at least two reasons scope is important. First, the larger a name's scope, the more likely it is that short names will end up c
by mightybyte 10y ago
This. So much this.
There are at least two reasons scope is important. First, the larger a name's scope, the more likely it is that short names will end up conflicting with other names at some point. Of course conversely, the smaller the scope is, the less likely it will conflict with something and the shorter you can make the name. And second, if the definition of something is a long ways away, then it becomes harder to find it to figure out the context. But in the example above, `u` has very small scope and its definition `users.map` is right there and makes it very easy to see what u stands for.
It's also important to realize that long names have a cost. Above the obvious small cost of typing time, it is also harder to disambiguate them visually.