
A long time ago, in a galaxy far far away, we were forced to name variables and methods with very short names. When I started my career, I was programming Clipper and C. Clipper was a dBase compiler, so it only had 10 characters available for variable names. You could write longer variable names if you wanted, but only the first 10 mattered. I think at the time, C gave us 32 characters. But now, we aren’t so limited. And so the argument goes, if you use long variable names, you shouldn’t need to comment your code. I’ve argued as much.
Of course every time you bring this subject up, you will inevitably find someone who will say, “But don’t we need comments to at least explain what the code was supposed to do? After all, code is generally hard to read.” Well, yes I guess it is if you are new to the language. But should every foreign movie have subtitles? Would you want native language movies to have subtitles because other people in the room might not understand it? Must we dumb everything down to the lowest common denominator? If so, where will it stop?
Read More