Re:Clarity over brevity in variable and method names
by wtetzner on Monday September 10, 2012 @03:36PM
(#4501750)
> 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.
Re:Clarity over brevity in variable and method names
by MBlume on Monday September 10, 2012 @04:00PM
(#4501895)
Haskellers don't so much want to keep the variable names terse as avoid naming the variable at all.
Re:Clarity over brevity in variable and method names
by wtetzner on Monday September 10, 2012 @04:16PM
(#4501989)
While 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.
Re:Clarity over brevity in variable and method names
by Evbn on Monday September 10, 2012 @10:55PM
(#4503520)
Haskell 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.
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.