4 ms·
This is a strawman. When have you ever heard someone say "Let's choose short variable names! Screw readability!" ? I don't buy that short variable names are
by j_baker 14y ago
This is a strawman. When have you ever heard someone say "Let's choose short variable names! Screw readability!" ?
I don't buy that short variable names are necessarily less clear. I think the ideal is to find variable names that are terse and clear. And I'm strongly in the camp that believes that brevity aids clarity.
- crazygringo 14y agoOh, man. I've heard it all the time. It's not so much "screw readability" as "long names are ugly and annoying to type, and if you can't figure out what 'i' and 'x' and 'dx' and 'j' mean in this context, then you lack intelligence and that's your problem, because it's obvious, duh. Real programmers are efficient, not verbose." I've worked with quite a number of programmers who seem to have a very hard time putting themselves in the shoes of someone who will have to read/maintain their code later. Good variable names are all about communication, and there are certainly programmers out there who don't have communication as one of their strong suits.
- debacle 14y ago> I've worked with quite a number of programmers who seem to have a very hard time putting themselves in the shoes of someone who will have to read/maintain their code later. We all do that. How many times have you looked at something, went "What asshole wrote this?" Only to find out from git that it was you?
- crazygringo 14y agoHa! Yeah... way more often than I'd like to admit.
- j_baker 14y agoIt sounds like what you're saying is that the strawmanning can go both directions. People who want longer variable names can be regarded as lacking intelligence and being inefficient. People who want shorter variable names can be regarded as not caring about readability or communication. The truth, as usual, is somewhere in the middle.
- zerostar07 14y agoOccam s razor is everywhere in programming, including function names