emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's the line length limit in the Emacs codebase?


From: Yuri Khan
Subject: Re: What's the line length limit in the Emacs codebase?
Date: Sat, 26 Dec 2020 18:36:29 +0700

On Sat, 26 Dec 2020 at 18:22, Michael Albinus <michael.albinus@gmx.de> wrote:

> >     6.2: Strings that cause the line to go over 100 characters
> >     should not be written across multiple lines using string concatenation.
> >
> >     > Why? Broken strings are painful to work with
> >     > and make code less searchable.
> >
> > [1]: https://github.com/airbnb/javascript#strings--line-length
> >
> > I have actually found myself trying to grep for an error message ang
> > failing to find it in code at first try because it was line-broken at
> > a non-obvious point.
>
> Yes, it is always a trade-off. However, I'm failing to find error
> messages in the code much more often because they are produced by
> format, which could be banned for the same reason.

When you see an error message, most of the time, it’s easy to see
which parts are constant text and which are substituted variable text.
Whereas line breaks could be anywhere.

When I break string literals to fit line length limits, I go for any
embedded \n first, then sentence boundaries, and only if that does not
bring the parts within limits, then phrase boundaries and
intra-sentence punctuation. This way, any run of text that contains no
punctuation or variable info has a high probability to be unbroken in
code.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]