All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] docs: Update the preferred line size to 100 characters
@ 2022-01-19 21:06 Steven Rostedt
  2022-01-19 23:00 ` Randy Dunlap
  2022-01-20  9:55 ` Sakari Ailus
  0 siblings, 2 replies; 4+ messages in thread
From: Steven Rostedt @ 2022-01-19 21:06 UTC (permalink / raw)
  To: LKML
  Cc: Linus Torvalds, Andrew Morton, Joe Perches, Andy Shevchenko,
	Sakari Ailus, Lucas De Marchi, Jonathan Corbet, linux-doc

From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

As commit bdc48fa11e46f ("checkpatch/coding-style: deprecate 80-column
warning") states:

    Increase the default limit to 100 characters.  Not because 100
    characters is some hard limit either, but that's certainly a "what are
    you doing" kind of value and less likely to be about the occasional
    slightly longer lines.

It's 2022, people are not using 80x24 terminals anymore (well I'm sure
someone is, but they are the small minority).

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 Documentation/process/coding-style.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst
index 03eb53fd029a..73be9edffede 100644
--- a/Documentation/process/coding-style.rst
+++ b/Documentation/process/coding-style.rst
@@ -101,10 +101,10 @@ Get a decent editor and don't leave whitespace at the end of lines.
 Coding style is all about readability and maintainability using commonly
 available tools.
 
-The preferred limit on the length of a single line is 80 columns.
+The preferred limit on the length of a single line is 100 columns.
 
-Statements longer than 80 columns should be broken into sensible chunks,
-unless exceeding 80 columns significantly increases readability and does
+Statements longer than 100 columns should be broken into sensible chunks,
+unless exceeding 100 columns significantly increases readability and does
 not hide information.
 
 Descendants are always substantially shorter than the parent and
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] docs: Update the preferred line size to 100 characters
  2022-01-19 21:06 [PATCH] docs: Update the preferred line size to 100 characters Steven Rostedt
@ 2022-01-19 23:00 ` Randy Dunlap
  2022-01-20  0:36   ` Joe Perches
  2022-01-20  9:55 ` Sakari Ailus
  1 sibling, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2022-01-19 23:00 UTC (permalink / raw)
  To: Steven Rostedt, LKML
  Cc: Linus Torvalds, Andrew Morton, Joe Perches, Andy Shevchenko,
	Sakari Ailus, Lucas De Marchi, Jonathan Corbet, linux-doc



On 1/19/22 13:06, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> 
> As commit bdc48fa11e46f ("checkpatch/coding-style: deprecate 80-column
> warning") states:
> 
>     Increase the default limit to 100 characters.  Not because 100
>     characters is some hard limit either, but that's certainly a "what are
>     you doing" kind of value and less likely to be about the occasional
>     slightly longer lines.


Has Linus has changed his view on this since 2016?
  https://lore.kernel.org/all/CA+55aFxaOFoh+Zrm5tNhU4hWu4Z032+nqV3vXK=QPJyhZsU3_A@mail.gmail.com/

Guess we will see.
I expect that the answer is "be reasonable," but that's subjective.

To me, it is easier to look below one line for something in context than it is
to have to scan several inches to the right and then back to the left (or vice versa).
Maybe I'm alone in that, but I doubt it.
It's sort of a locality of vision thing.


> It's 2022, people are not using 80x24 terminals anymore (well I'm sure
> someone is, but they are the small minority).
> 
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
>  Documentation/process/coding-style.rst | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst
> index 03eb53fd029a..73be9edffede 100644
> --- a/Documentation/process/coding-style.rst
> +++ b/Documentation/process/coding-style.rst
> @@ -101,10 +101,10 @@ Get a decent editor and don't leave whitespace at the end of lines.
>  Coding style is all about readability and maintainability using commonly
>  available tools.
>  
> -The preferred limit on the length of a single line is 80 columns.
> +The preferred limit on the length of a single line is 100 columns.
>  
> -Statements longer than 80 columns should be broken into sensible chunks,
> -unless exceeding 80 columns significantly increases readability and does
> +Statements longer than 100 columns should be broken into sensible chunks,
> +unless exceeding 100 columns significantly increases readability and does
>  not hide information.
>  
>  Descendants are always substantially shorter than the parent and

-- 
~Randy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] docs: Update the preferred line size to 100 characters
  2022-01-19 23:00 ` Randy Dunlap
@ 2022-01-20  0:36   ` Joe Perches
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2022-01-20  0:36 UTC (permalink / raw)
  To: Randy Dunlap, Steven Rostedt, LKML
  Cc: Linus Torvalds, Andrew Morton, Andy Shevchenko, Sakari Ailus,
	Lucas De Marchi, Jonathan Corbet, linux-doc

On Wed, 2022-01-19 at 15:00 -0800, Randy Dunlap wrote:
> 
> On 1/19/22 13:06, Steven Rostedt wrote:
> > From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> > 
> > As commit bdc48fa11e46f ("checkpatch/coding-style: deprecate 80-column
> > warning") states:
> > 
> >     Increase the default limit to 100 characters.  Not because 100
> >     characters is some hard limit either, but that's certainly a "what are
> >     you doing" kind of value and less likely to be about the occasional
> >     slightly longer lines.
> 
> 
> Has Linus has changed his view on this since 2016?
>   https://lore.kernel.org/all/CA+55aFxaOFoh+Zrm5tNhU4hWu4Z032+nqV3vXK=QPJyhZsU3_A@mail.gmail.com/
> 
> Guess we will see.
> I expect that the answer is "be reasonable," but that's subjective.
> 
> To me, it is easier to look below one line for something in context than it is
> to have to scan several inches to the right and then back to the left (or vice versa).
> Maybe I'm alone in that, but I doubt it.

You are not alone.

Reading left to right is relatively easy but for long line lengths
the eye movement to the next appropriate line is not at all easy.

> It's sort of a locality of vision thing.

Yup.

I think this is not a good patch.

The preferred line length should stay relatively small at 80 and not
allow an entire file to be wrapped to 100.

I'd still prefer a warning when any new identifier is longer than some
length like say 20 characters.

> > It's 2022, people are not using 80x24 terminals anymore (well I'm sure
> > someone is, but they are the small minority).
> > 
> > Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> > ---
> >  Documentation/process/coding-style.rst | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst
> > index 03eb53fd029a..73be9edffede 100644
> > --- a/Documentation/process/coding-style.rst
> > +++ b/Documentation/process/coding-style.rst
> > @@ -101,10 +101,10 @@ Get a decent editor and don't leave whitespace at the end of lines.
> >  Coding style is all about readability and maintainability using commonly
> >  available tools.
> >  
> > -The preferred limit on the length of a single line is 80 columns.
> > +The preferred limit on the length of a single line is 100 columns.
> >  
> > -Statements longer than 80 columns should be broken into sensible chunks,
> > -unless exceeding 80 columns significantly increases readability and does
> > +Statements longer than 100 columns should be broken into sensible chunks,
> > +unless exceeding 100 columns significantly increases readability and does
> >  not hide information.
> >  
> >  Descendants are always substantially shorter than the parent and
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] docs: Update the preferred line size to 100 characters
  2022-01-19 21:06 [PATCH] docs: Update the preferred line size to 100 characters Steven Rostedt
  2022-01-19 23:00 ` Randy Dunlap
@ 2022-01-20  9:55 ` Sakari Ailus
  1 sibling, 0 replies; 4+ messages in thread
From: Sakari Ailus @ 2022-01-20  9:55 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Linus Torvalds, Andrew Morton, Joe Perches,
	Andy Shevchenko, Lucas De Marchi, Jonathan Corbet, linux-doc

Hi Steven,

Thank you for cc'ing me.

On Wed, Jan 19, 2022 at 04:06:42PM -0500, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> 
> As commit bdc48fa11e46f ("checkpatch/coding-style: deprecate 80-column
> warning") states:
> 
>     Increase the default limit to 100 characters.  Not because 100
>     characters is some hard limit either, but that's certainly a "what are
>     you doing" kind of value and less likely to be about the occasional
>     slightly longer lines.
> 
> It's 2022, people are not using 80x24 terminals anymore (well I'm sure
> someone is, but they are the small minority).
> 
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
>  Documentation/process/coding-style.rst | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst
> index 03eb53fd029a..73be9edffede 100644
> --- a/Documentation/process/coding-style.rst
> +++ b/Documentation/process/coding-style.rst
> @@ -101,10 +101,10 @@ Get a decent editor and don't leave whitespace at the end of lines.
>  Coding style is all about readability and maintainability using commonly
>  available tools.
>  
> -The preferred limit on the length of a single line is 80 columns.
> +The preferred limit on the length of a single line is 100 columns.
>  
> -Statements longer than 80 columns should be broken into sensible chunks,
> -unless exceeding 80 columns significantly increases readability and does
> +Statements longer than 100 columns should be broken into sensible chunks,
> +unless exceeding 100 columns significantly increases readability and does
>  not hide information.

As others have already opined, I agree that increasing the line length from
80 isn't going to make the code universally (or even mostly) more readable.
There are probably cases it does but this is not necessarily common.

I think the original text puts it well: there is a limit of 80 but that is
not a hard limit. When reviewing code, I often ask to wrap lines if there's
really no reason to keep them longer (in this case that seldom is the only
problem with the code). Of course you could argue what these reasons might
be. At the very least indentation has a higher precedence that the line
length. This is also written in the documentation.

My view is that this recommendation is not, at least today, relevant for
the purpose of making the code readable for someone with a VT100 terminal,
but a part of a recipe for writing good code simply expressed in units
everyone knows: VT100 terminal size. Also 80x24 is still the default window
size of many if not most terminal emulators.

-- 
Kind regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-20  9:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19 21:06 [PATCH] docs: Update the preferred line size to 100 characters Steven Rostedt
2022-01-19 23:00 ` Randy Dunlap
2022-01-20  0:36   ` Joe Perches
2022-01-20  9:55 ` Sakari Ailus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.