4 ms·
there are really smart people in the camp of long variable names, and there are really smart people in the camp of terse variable names. both sets are optimizin
by dustingetz 14y ago
there are really smart people in the camp of long variable names, and there are really smart people in the camp of terse variable names. both sets are optimizing towards whatever subjective definition of "good code" they have, where, again, their definition is informed and intelligent even if it differs.
if someone really smart says they use terse variable names, you don't tell them they're wrong, you try to understand them. There exist styles of writing high quality code that don't need naming style like `someone_else_just_finished_writing?`. there are styles that use it. if you're only accustomed to the long way, you'd be well served to go join a successful team that uses the short way, instead of blindly saying that they're wrong. some of the clearest code i've ever seen was Haskell, for which i think most people find you don't need long names.
me, when i find myself needing long names, i try to refactor until i don't need them any more. its not always possible given time constraints, backwards compat, trying not to change fragile code etc, but i mostly chalk that up to a personal or team failing.
- wtetzner 14y ago> there are really smart people in the camp of long variable names, and there are really smart people in the camp of terse variable names. Like the Scheme and Haskell communities, respectively.
- MBlume 14y agoHaskellers don't so much want to keep the variable names terse as avoid naming the variable at all.
- wtetzner 14y agoWhile that's true, there's a tendency to use short names in pattern matching, since using long names actually makes it harder to read the pattern.
- Evbn 14y agoHaskell code names all identifiers except unused ones place held with '_'. (Unlike perl, which has the day default $_ often in scope) Haskellers completely avoid introducting entities (like function arguments) where they aren't needed.