4 ms·
Assuming you have been writing code with single letter variables for long enough, try opening a medium to large sized project you wrote a few years ago and no l
by ddebernardy 8y ago
Assuming you have been writing code with single letter variables for long enough, try opening a medium to large sized project you wrote a few years ago and no longer use or maintain. See if you still understand your own code.
Descriptive variables are about maintainability. And when it comes to the latter, the guiding principle is:
> Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
^ https://stackoverflow.com/q/876089/417194 https://stackoverflow.com/q/876089/417194
- jjoonathan 8y agoI have had success using long names to good effect in non-mathematical code, but in mathematical code, I have never gotten them to work very well. I've tried many times over the years, but I just never seem to be able to squeeze all the relevant information into the names without making them excessively long, and even then I usually find upon rediscovery that I have omitted an important detail. Mathematics seems to thrive on a kaleidoscopic abundance of subtle but important variations on similar themes and this really frustrates the ability to encode information in the names. Also, the necessity of building an abstract-mathematical mental picture separate from the code obviates the need. The value proposition of verbose naming conventions entirely falls apart under these conditions, and once it does, the benefits of concision rule the day.