3 ms·
The saddest thing is that computer science looks up to math and emulates the worst of it, such as cryptic, short variable names.
by br1 15y ago
The saddest thing is that computer science looks up to math and emulates the worst of it, such as cryptic, short variable names.
- Wickk 15y agoWhat you're describing is actually bad practice. Not saying it's not a problem, but that's not an intentional emulation.
- Peaker 15y agoIt depends. Variable name length is mainly related to two things: * Scope the variable resides over * Generality of the variable If the scope is large (the variable is global and exposed to a lot of code), the variable name has to be longer, so that far away readers can make sense of it. A variable that scopes over 2 lines is allowed to be much shorter, especially if its definition is as clear or clearer than an arbitrary name. As for the generality, if you write a function addEmployeeSalaries, of course that is a better name than some arbitrary short name (e.g: "addEm"). But when writing (very very) general code, it is hard to avoid situations where the variable denotes only structure. It is just too general to find a useful long (and specific) name. For example, consider: flip f x y = f y x sequence :: Monad m => [m a] -> m [a] Single-letter variable (and type variable) names, but considered perfectly good practice.
- blake8086 15y agoI like to think of computer science as: "Math, in terms even computers can understand"