Excessive line breaks are bad
lkml.iu.edu
Excessive line breaks are bad
1–10 of 16 posts
Re: Excessive line breaks are bad
#2Re: Excessive line breaks are bad
#3Re: Excessive line breaks are bad
#4Re: Excessive line breaks are bad
#5Re: Excessive line breaks are bad
#6I know he's primarily talking about terminal output not code, but he implies it's for code too "and our source code is fundamentally wider as a result". Seems like a very sloppy transition of a huge project to a new vague standard? I'm not impressed the clarity here.
[1] -https://www.kernel.org/doc/html/v4.10/process/coding-style.h...
Re: Excessive line breaks are bad
#7Re: Excessive line breaks are bad
#8"Tab depth use in the kernel is more or less
$ git grep -Poh '^\t+(if|do|while|for|switch)\b' | \
sed -r 's/\w+//g' | \
awk '{print length($0);}' | \
sort | uniq -c | sort -rn
903993 1
339059 2
89334 3
18216 4
3282 5
605 6
148 7
36 8
4 9
1 10
http://lkml.iu.edu/hypermail/linux/kernel/2005.3/06570.htmlI like seeing these "back of the napkin" sorts of code snippets revealed... this is the sort of thing that happens frequently but isn't ever shared because of its throwaway/ephemeral nature.
And also, yeah, low tab depth is way more relevant than line length as far as clean code.
Re: Excessive line breaks are bad
#9After missing some errors in long lines during code review, i feel like <60 should be the target. side by side diffs are most common view for me in 'github flow'
Even at 80 I occasionally sacrifice readability for line breaks to keep my company's linter from throwing a fit. 60 does not sound like a good idea to me.
Re: Excessive line breaks are bad
#10I'm confused. This page [1] claims to be the "Linux kernel coding style" and it says "The limit on the length of lines is 80 columns and this is a strongly preferred limit". So he's reversing that without actually updating the guide? And without setting a new limit? He implies maybe "100" is a good limit but maybe "142" is even better? Weird. I know he's primarily talking about terminal output not code, but he implie…
https://lkml.org/lkml/2020/5/28/78
https://lkml.org/lkml/2020/5/28/1237
Although you're right that his comment made the coding standard ambiguous, I found myself agreeing with Linus in this particular case. What we need to do often in a large C project is to grep some function prototype against the source tree, and it sucks if it's wrapped like this.