Hacker News new | ask | show | jobs
by usrbinbash 1614 days ago
> and figure out the hard way what `f` is used for.

In a 20 LOC function, that takes me about a second, if that long.

> aside from Notepad pretty much every editor offers some completion feature

It's still easier to type `f` than `fi` + leadkey + N or whatever the editor uses. Bonus points if the first prediction is wrong, or ambivalent.

And the more important reason is "easier to read", especially in long expressions;

    for e := getFirst(); e != nil; e.Next()
is much easier to read than

    for currentElement := getFirst(); currentElement != nil; currentElement.Next()
Finally, not only the name itself, but also it's length should convey meaning. If I see a variable like `currentElement` in my code, I immediately know that it probably lives beyond the scope it is defined in. If I see a variable named `c` I know that it is a short lived throwaway.