3 ms·
Personally I find the splitting in the for loop much harder to read, though the smatch splitting is fine. I would favor splitting only if you're indenting to l
by ajanuary 14y ago
Personally I find the splitting in the for loop much harder to read, though the smatch splitting is fine.
I would favor splitting only if you're indenting to line up with the first couple of tokens. In those cases the pattern is obvious as soon as I start reading, and my brain switches to scanning vertically. I find it jarring to have to switch from having read most of a line to suddenly scan vertically.
It seems like the example doesn't demonstrate the point that precedes it at all. Apparently in this example an 80 character limit doesn't promote re-factoring, it promotes splitting lines. Which makes the justification for 80 characters being a typical line length + 4 indentations a bit weak and 80 is back to being arbitrary.
- nonamegiven 14y agoI don't quite like the loop split, but that's because I've never like "continue the next line under the first argument of the series." It makes next lines start at inconsistent places and makes it harder to read. I usually bend that rule and follow the four space indent 90% of the time. But I do like the loop split better than the non-split, despite the above. I like the smatch split too. It looks like how you'd arrange bullets in a bullet list, one below the other, so you can see/scan them at a glance, without having to labor over where the next item is in a single line.