4 ms·
this is the age-old "do it the way I'm used to and it'll be better" argument. Descriptive variable naming _is_ hard, and unlike function and parameter naming,
by ledauphin 5y ago
this is the age-old "do it the way I'm used to and it'll be better" argument.
Descriptive variable naming _is_ hard, and unlike function and parameter naming, it is avoidable in many cases! By naming a temporary variable, you ask other developers to consider the possibility that you might be doing multiple things with it - not doing so allows a simplified read with confidence that this is a pure function pipeline with no unrelated side effects.
Naming is a great and hard and valuable thing - temporary variables are only good inasmuch as your readers habitually expect them - and habits can be changed, thank goodness!