> Meaningless names, like `x` or `fn`, require the programmer to understand and remember extra layers of context while reading code that uses them.
Reading code always requires context, which humans are actually very good at handling. And if you refuse to use short names where they suffice you will clutter the code. This feels like a false optimisation of our ability to handle context.
What's more readable/understandable?
/* Gets sum of numbers from 1 to n */
sum(n)
{
return n * (n + 1) / 2;
}
Or: /* Gets sum of numbers from 1 to largestNumber */
sum(largestNumber)
{
return largestNumber * (largestNumber + 1) / 2;
}
Have mathematicians been wrong for hundreds of years by using short symbolic names for their different variables? Imagine what maths would be like today if they were told they needed to use long names every to optimise 'context'.