3 ms·
For me, the last example feels messy for two reasons. First, I have to worry about matching parens. That can feel mentally exhausting even for simple cases. S
by cout 4y ago
For me, the last example feels messy for two reasons. First, I have to worry about matching parens. That can feel mentally exhausting even for simple cases. Second, it's written all on one line, so it's harder to mentally separate all the steps. I usually break expressions like that apart into separate lines, but that means finding concise yet meaningful names for temporary variables.
- smcl 4y agoOh yeah I would definitely split them up into little intermediate steps. But then I’d get a bit sad that I don’t have the pipe operator :-)