3 ms·
Not really. Go also encourages short, concise names, and it seems to work pretty well... or at least not be causing significant headaches so far as I can tell.
by kevhito 9y ago
Not really. Go also encourages short, concise names, and it seems to work pretty well... or at least not be causing significant headaches so far as I can tell.
Why would one be forgetting and grepping for tmp? That's the kind of variable that would be inside a function (so max one or two screenfuls, according to the guidelines here), and more realistically would usually be declared and used entirely within the same block of a dozen or so lines of code. Nobody is going to forget whether it is temp or temp while reading those 12 lines of code. And using temporary is just silly -- I can't think of a single time I've ever seen that used in any language.
- chimprich 9y agoMaybe grepping for the variable is a bad example. I have seen bugs where a variable has been accidentally defined twice though due to inconsistent abbreviations. I'm struggling to think of any case where "tmp" couldn't be replaced by a better name. It's always going to be a temporary something. I'm not arguing against short, concise names where they won't cause problems. Variable names of e.g. x, y, i all have their place.