4 ms·
"err". Because "error" is too hard to type, right?
by fagnerbrack 10y ago
"err". Because "error" is too hard to type, right?
- matthewmacleod 10y agoWell, `error` is the type, and `err` is the most common variable name. It's not so unusual, just convention!
- the_duke 10y agoAlso, it cuts the characters you have to type and read in halve, while not being obtuse. That's an odd thing to complain about.
- stirner 10y agoNo, because error variables have extremely limited scope and the length of a variable name should be proportional to its scope.
- kbart 10y agoHeh, I always use longer name variables for broader scope somewhat naturally, but only after reading your comment realized that.
- bryanrasmussen 10y agoI figure it's probably proportional to its importance and difficulty of understanding, as a longer more descriptive name aids in understanding, but things with broader scope tend to be more important.
- hyperpape 10y agoFrom which it follows that you should use the most terse names possible, in order to make it harder to write too-long functions. (I am only half trolling).
- deleted 10y ago[deleted]
- open-source-ux 10y agoI wonder the same thing about "elif" in Python. It's two extra characters to make it the more pleasant, readable "elseif". I don't understand why dropping those letters was felt necessary.
- uranusjr 10y agoA lot of older parts in Python inherit the naming style common in C, which always seems to me they have OCD to shorten everything, e.g. ls for list, mk for make. Newer Python parts are more “healthy” in this regard. But this also results in some wierd inconsistencies like mkdir vs makedirs.
- chei0iaV 10y agoC has else and if, not elif. I'm actually curious why in Python "else if" is a syntax error.
- deleted 10y ago[deleted]