4 ms·
>Use more namespaces, write smaller functions, embrace lexical scoping, etc. You don't need to call something a foo-bar-frobber when it's being used in the foo-
by danssig 15y ago
>Use more namespaces, write smaller functions, embrace lexical scoping, etc. You don't need to call something a foo-bar-frobber when it's being used in the foo-bar context, just call it a frobber.
I agree with this part and code this way.
>line noise
I generally follow this, it depends on how clear the abbreviation is. If I would need a comment I'll spell out the name instead.
>I always feel dirty when I have a long variable name.
Once it passes a certain size, I do too.
>pg writes about this in On Lisp: long names feel heavier.
This is something I strongly disagree with pg on and I would point to arch as prove that he's wrong here. Arch uses ridiculously short names for everything and I personally can't stand the language. As far as I can tell, the language never got popular despite a decent sized group of people waiting to see what pg would make.
>They might be super cheap to call, but because the name is long, you're less likely to call it.
I think pg arrives at this position because he uses vi. If you have a really nice IDE that does advanced code completion (e.g. I can type "RBV <tab>" for ReallyBigVariable) you'll find that you're no less likely to use a long variable or function name.
>Furthermore, I much rather adhere to a line length limit,
Agreed.