Otherwise I agree, people have a weird hang up about short variable names. Somehow not a problem in mathematics...
Otherwise I agree, people have a weird hang up about short variable names. Somehow not a problem in mathematics...
I have slightly unorthodox opinions about short variables. I used to hate them. Then I posted a question on one of the PL design forums - it might have been Reddit r/programminglanguages - why is there are history of single letter names for type variables? ie T, U, etc for generics. The answer I got back, was, sometimes you want code to focus on structure rather than identities. That stuck with me, because it helped me understand why so much C code (including Linux) code uses similar naming practices. Names can lie, and sometimes expressing the structure is the absolute critical thing.
The specificity or abstractness of a (variable) name relates to the values that it can hold. So when you have a very abstract function whose inputs can be of almost any type, naming those inputs in an overly-specific manner is an exact inverse of the failure of giving an overly generic to name highly constrained parameter.
Examples of correct naming:
func firstWord(s string) string { ... }
func bidShortcodePrefix(businessId string) string { ... }
Examples of incorrect naming: func firstWord(strWithOptionalSpaces string) string { ... }
func bidShortcodePrefix(s string) string { ... }
All this said, I do agree with your original take on the comments. I much prefer having human-readable explanations inline with anyhow non-trivial code. If nothing else, they really make it easier to correctly fix the code if a bug is found much later.