Conversation
Edited 6 days ago

Guys, so what is the current consensus on line length in the kernel? Coding style still says:

The preferred limit on the length of a single line is 80 columns.

This is not a hard limit and it may (or even must) be exceeded if there are good reasons. That's also mentioned in the document. But then I get a nitpick like this:

It is still under the 100 character limit.

Where does it come from? Should the coding style be updated?
@corbet ?

4
0
0

@ptesarik @corbet people vary in attitude, you're not going to go wrong at 80 chars, but 100 is kinda the hard limit in reality (I think checkpatch.pl defaults to this).

I'd say look at how things are done in the file you are editing + imitate generally.

Personally I try to keep to 80 chars but will go over it if a few chars more would prevent it turning to a mess.

But it really does vary throughout the kernel and it is annoying yes

1
0
0

@ljs @ptesarik @corbet basically you can try 100 and it will be fine until hch replies to your patch.

1
0
0

@ptesarik 80×25 to 100×whatever is what 4:3 monitors are to 16:9/10.

@corbet

1
0
0
@ptesarik @corbet Coding style does not need update, it is vague on purpose, because sticking to hard limits is not necessarily good. That's why checkpatch has different limit - people treated its output too literally.
Now some maintainers PREFER 100. I don't know your case here - ask maintainer of that code, which might be that person nitpicking you :)
1
0
1
shitpost
Show content

@vbabka @ljs @corbet
Ah, Christoph! IIRC he was identified as the most vigorous NAKer of all times.
Well, then it's fine, Christoph has already put his Acked-by on my patches, including some buggy ones.

0
0
0

@krzk @corbet
Thank you. I know how to read Coding Style, but it's not exactly vague on this matter, so maybe I should patch it to make it less specific—or rather not; I don't have time for bikeshedding flamewars.

1
0
0
shitpost
Show content

@oleksandr @corbet
Hey, you guys don't code on a physical DEC VT102 either? Then why do we maintain all that tty compatibility cruft?

1
0
0
shitpost
Show content

@ptesarik I ask myself the very same question each time I have to read TTY code.

@corbet

0
0
0

@vegard @corbet
Yes, exactly, but I have always read it as Linus trying to soften the limit (so people stop freaking out about an occasional 81-column line), rather than pushing a hard limit up by some 20 columns.

0
0
1
@ptesarik @corbet OK, so answering more precisely your question from where does 100 come - from checkpatch. Sometimes people identify checkpatch as the coding style. But few maintainers expressed on mailing list preference of 100.
0
0
2