3 ms·
Historically I would have agreed with this position, but debuggers have gotten a lot better, so it's typically possible to break wherever you need to. The inte
by pacaro 5y ago
Historically I would have agreed with this position, but debuggers have gotten a lot better, so it's typically possible to break wherever you need to.
The intermediate variables still have value, just not as much as they used to, and they do (arguably) increase the cognitive load for the reader
- colordrops 5y agoBut intermediate variables are almost always better if named properly, as they provide a contextual name as to the purpose of the output of the function. Then only very minor downside is a bit more typing and more lines of code.
- slaymaker1907 5y agoYou forgot the biggest downside which is that naming things is hard. It also often causes important names to get lost in the jumble of temporary names.