<div dir="ltr">ok, but looking at <a href="https://review.coreboot.org/#/c/coreboot/+/26512/">https://review.coreboot.org/#/c/coreboot/+/26512/</a>, is there any single thing in there that stands out as a a problem? Every single change looks better to me.<div><br></div><div>I still don't see the problem with 132. I did a quick check on the Go source tree, where there basically are no limits for 10 years now, and there are very few cases where lines are longer than 80, but in those cases, readability is superior for those long lines. I suspect, based on my little test, that the same is true of coreboot. People tend to write to 80, but occasionally, things are longer, and at least for me, this</div><div><br></div><div>printk(BIOS_DEBUG, "Exception: %s\n", exception_names[tf->cause]);<br></div><div><br></div><div>is much more readable than this</div><div><br></div><div><div>printk(BIOS_DEBUG, "Exception: %s\n",</div><div><span style="white-space:pre"> </span>exception_names[tf->cause]);</div></div><div><br></div><div>I'm fine with strongly recommending we stick to 80, but I'd really like to get away from making it mandatory. And, further, I'd like to see us move to clang-format on commits, so we can end these discussions as they have ended them in the Go and Rust communities.</div><div><br></div><div>If somebody every submits a 512-length line, I think we can convince them to see reason :-)</div><div><br></div><div>ron</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, May 25, 2018 at 9:41 AM Nico Huber <<a href="mailto:nico.h@gmx.de">nico.h@gmx.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 25.05.2018 10:15, Patrick Georgi via coreboot wrote:<br>
> That is, who would unbearably suffer from 132 characters gper line of code?<br>
<br>
Humans. Code quality.<br>
<br>
Eyes get too tired too fast. The cost of our eyes' "carriage return"<br>
grows over-linear with the line length. Although, that's hard to<br>
measure, I'm sure 132 chars would have a negative impact on review<br>
quality. The cost of comparing two views side-by-side increases too,<br>
with the distance between them.<br>
<br>
A general rule from printed text is that you should keep the column<br>
width below 70 chars on average. You can't apply that directly to fixed-<br>
width fonts and, obviously, code lines are not like running text (ide-<br>
ally a statement ends before hitting any line break). But, in every pro-<br>
ject that allows longer lines, I've seen people starting to use the<br>
extra space also for comments. And comments at 132 chars? that would<br>
really be unbearable.<br>
<br>
IMHO, the problem with 80 chars is that it is just a little too nar-<br>
row for code. It's a good length at function scope but even only two<br>
additional levels of indentation, and you have only 56 chars left. So<br>
I generally agree to lift the limit, but not too high and not uncon-<br>
ditionally.<br>
<br>
Looking at what has been written in this thread so far, I see three<br>
major cases that people care about:<br>
<br>
1. Function signatures,<br>
2. Code lines and<br>
3. Code lines containing string literals[1].<br>
<br>
Let's assume 72 chars of visible width (line length minus the inden-<br>
tation) is enough for code lines. If we say two additional indentation<br>
levels are always reasonable (a third might be too, here and there) we<br>
would be at 96 chars.<br>
<br>
So I would compromise as follows:<br>
<br>
o Set a hard limit around 100 chars (96 would be a nice number).<br>
o If a line doesn't contain a string literal, recommend a<br>
visible width <= 72 chars.<br>
<br>
Nico<br>
<br>
[1] I think we should treat the latter two separately because you can<br>
easily argue that lines with a string literal might get too long but<br>
if you apply the same rules to regular code, you'll get all the<br>
crappy stuff (too many levels of indentation, unnecessary long, less<br>
distinctive identifiers etc.).<br>
<br>
-- <br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org" target="_blank">coreboot@coreboot.org</a><br>
<a href="https://mail.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">https://mail.coreboot.org/mailman/listinfo/coreboot</a><br>
</blockquote></div>