[PROPOSAL] Don't split user visible messages across multiple lines

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[PROPOSAL] Don't split user visible messages across multiple lines

Alexandru Elisei
I was working on emerge --sync and my test repo configuration
generated several warning messages. Finding the exact location where
the warnings was generated was surprisingly difficult because the
message string was split across three lines due to the 80 character
line limit and I had to grep for different patterns until I found one
that matched part of a line.

I propose that messages that are visible to the user never be split
across multiple lines. This is also the coding style convention used
by the linux kernel:
https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings

If accepted, this could go in the DEVELOPING file.

Reply | Threaded
Open this post in threaded view
|

Re: [PROPOSAL] Don't split user visible messages across multiple lines

Brian Dolbec-3
On Mon, 27 Feb 2017 20:33:28 +0200
Alexandru Elisei <[hidden email]> wrote:

> I was working on emerge --sync and my test repo configuration
> generated several warning messages. Finding the exact location where
> the warnings was generated was surprisingly difficult because the
> message string was split across three lines due to the 80 character
> line limit and I had to grep for different patterns until I found one
> that matched part of a line.
>
> I propose that messages that are visible to the user never be split
> across multiple lines. This is also the coding style convention used
> by the linux kernel:
> https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings
>
> If accepted, this could go in the DEVELOPING file.
>

That could be pretty hard to do for all messages.
Especially messages with embedded data

  eg:  "%s is missing %s required use flag..." % ('sys-apps/foo', 'bar')


I know I don't always enforce the line length for a few characters,
also when clarity is more important than line length.

We could also increase the max. line length to something like 120 or 130.

--
Brian Dolbec <dolsen>


Reply | Threaded
Open this post in threaded view
|

Re: [PROPOSAL] Don't split user visible messages across multiple lines

Alexandru Elisei
On Thu, Mar 16, 2017 at 12:32 AM, Brian Dolbec <[hidden email]> wrote:
> That could be pretty hard to do for all messages.
> Especially messages with embedded data
>
>   eg:  "%s is missing %s required use flag..." % ('sys-apps/foo', 'bar')

For that case we could use:

    "%s is missing %s required use flag..." % \
        % ('sys-apps/foo', 'bar')

> I know I don't always enforce the line length for a few characters,
> also when clarity is more important than line length.

I totally agree with that.

> We could also increase the max. line length to something like 120 or 130.

I think more people should chime in on that. I use vertical splits for
the screen when coding, and 120 characters is too long for me, but if
the preferred width ends up changing to 120 or 130 I can work with it.

Reply | Threaded
Open this post in threaded view
|

Re: [PROPOSAL] Don't split user visible messages across multiple lines

Brian Dolbec-3
On Thu, 16 Mar 2017 09:43:08 +0200
Alexandru Elisei <[hidden email]> wrote:

> On Thu, Mar 16, 2017 at 12:32 AM, Brian Dolbec <[hidden email]>
> wrote:
> > That could be pretty hard to do for all messages.
> > Especially messages with embedded data
> >
> >   eg:  "%s is missing %s required use flag..." % ('sys-apps/foo',
> > 'bar')  
>
> For that case we could use:
>
>     "%s is missing %s required use flag..." % \
>         % ('sys-apps/foo', 'bar')

Yes, but that is not what I meant.  When you are searching the code for
a message.

  the message in your terminal would read
"sys-apps/foo is missing bar required use flag..."

It may not be obvious to people to break up the text to search into 2
strings.  "is missing" and "required use flag..."  trying one, failing
that try the other to find the code location.  Then there is the
problem of translations moving/re-arranging the text to suit the
language (minor I know, but still a factor to consider).


> > I know I don't always enforce the line length for a few characters,
> > also when clarity is more important than line length.  
>
> I totally agree with that.
>
> > We could also increase the max. line length to something like 120
> > or 130.  
>
> I think more people should chime in on that. I use vertical splits for
> the screen when coding, and 120 characters is too long for me, but if
> the preferred width ends up changing to 120 or 130 I can work with it.
>

You need to get some large 4K monitors... love them :D
I treated myself to two 28 inch ones during boxing week sales.
My aging eyes love them :)  They are so much better than my old 24 inch
1080p monitors.  Those were getting tired/starting to loos clarity along
with my eyes working at them all week long.  I now work with larger
fonts which are still physically smaller than my old monitors, but
sooooo much clearer.  My eyes don't get nearly so tired as they did
with my other monitors.

</bragging> ;)


 My work has a 130 col limit.  With an editor at that,
plus a wide, open files pane on the left of the editor window, I still
have another large terminal window open to it's right with some bare
screen real-estate patches and borders... ;)  Not to mention nearly 100
lines of code view-able in the editor.

--
Brian Dolbec <dolsen>


Reply | Threaded
Open this post in threaded view
|

OT: Screen bragging. Was: [PROPOSAL] Don't split user visible messages across multiple lines

Duncan-42
Brian Dolbec posted on Thu, 16 Mar 2017 01:08:30 -0700 as excerpted:

>> > We could also increase the max. line length to something like 120 or
>> > 130.
>>
>> I think more people should chime in on that. I use vertical splits for
>> the screen when coding, and 120 characters is too long for me, but if
>> the preferred width ends up changing to 120 or 130 I can work with it.
>>
>>
> You need to get some large 4K monitors... love them :D I treated myself
> to two 28 inch ones during boxing week sales.
> My aging eyes love them :)  They are so much better than my old 24 inch
> 1080p monitors.  Those were getting tired/starting to loos clarity along
> with my eyes working at them all week long.  I now work with larger
> fonts which are still physically smaller than my old monitors, but
> sooooo much clearer.  My eyes don't get nearly so tired as they did with
> my other monitors.
>
> </bragging> ;)

Posting resistance failing...

Try a 65-inch 4K with a 48-inch 1080p (now the older monitor, often
running youtube full-screen) off to the side. =:^)

(They're actually TVs used as monitors via the HDMI input, no actual TV
hooked up.  Above about 32-inch, TVs tend to be cheaper than stand-alone
monitors and of course they're the same 4K high or full-hd lower
resolution these days.)

Six 1280x1080 working windows three wide by two stacked on the 65" 4k,
still set for 96 dpi standard, FreeMono Bold 9.0 in my konsole windows,
yields:

$ echo $COLUMNS x $LINES
179 x 78

And that's six of those on the 65" 4K, PLUS the full-screen 1080p youtube
or whatever window on the 48". =:^)

This is the first time I can honestly say I have enough screen space that
most of the time I'm not actively using it all. =:^)

--
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


Reply | Threaded
Open this post in threaded view
|

Re: OT: Screen bragging. Was: [PROPOSAL] Don't split user visible messages across multiple lines

Brian Dolbec-3
On Fri, 17 Mar 2017 06:58:23 +0000 (UTC)
Duncan <[hidden email]> wrote:

> Brian Dolbec posted on Thu, 16 Mar 2017 01:08:30 -0700 as excerpted:
>
> >> > We could also increase the max. line length to something like
> >> > 120 or 130.  
> >>
> >> I think more people should chime in on that. I use vertical splits
> >> for the screen when coding, and 120 characters is too long for me,
> >> but if the preferred width ends up changing to 120 or 130 I can
> >> work with it.
> >>
> >>  
> > You need to get some large 4K monitors... love them :D I treated
> > myself to two 28 inch ones during boxing week sales.
> > My aging eyes love them :)  They are so much better than my old 24
> > inch 1080p monitors.  Those were getting tired/starting to loos
> > clarity along with my eyes working at them all week long.  I now
> > work with larger fonts which are still physically smaller than my
> > old monitors, but sooooo much clearer.  My eyes don't get nearly so
> > tired as they did with my other monitors.
> >
> > </bragging> ;)  
>
> Posting resistance failing...
>
> Try a 65-inch 4K with a 48-inch 1080p (now the older monitor, often
> running youtube full-screen) off to the side. =:^)
>
> (They're actually TVs used as monitors via the HDMI input, no actual
> TV hooked up.  Above about 32-inch, TVs tend to be cheaper than
> stand-alone monitors and of course they're the same 4K high or
> full-hd lower resolution these days.)
>
> Six 1280x1080 working windows three wide by two stacked on the 65"
> 4k, still set for 96 dpi standard, FreeMono Bold 9.0 in my konsole
> windows, yields:
>
> $ echo $COLUMNS x $LINES
> 179 x 78
>
> And that's six of those on the 65" 4K, PLUS the full-screen 1080p
> youtube or whatever window on the 48". =:^)
>
> This is the first time I can honestly say I have enough screen space
> that most of the time I'm not actively using it all. =:^)
>

Yeah, I've seen lots of those types of setups.

Just a few years ago when I was an A/C mechanic for my day job, I
serviced A/C systems at numerous business's trading floors, where many
stations ran 2 or 3 pc's mostly to house/power the video cards to
drive 4,6, sometimes 8 monitors in a dual high setups, then numerous big
screens overhead in various places around the floor...

I don't think I could handle the large ones like you have, my eyes
haven't got the focal range for that anymore.  As it is, I recently had
to pull my monitors closer about 8 inches because my eyes were getting
too tired by the end of the week.  They were just too close to the
limits of my eyes and glasses.

I do need to get a decent video card to drive these new 4K's, then
maybe I'll think about re-connecting the old 24 inch 1080p's back up
to the old card too  ;)  But if I really needed more screen space, I'd
pick up 2 more of these 4k's, 2 video cards and spin them vertical ;)
 That could make for a great driving/flight simulator :D


--
Brian Dolbec <dolsen>


Reply | Threaded
Open this post in threaded view
|

Re: OT: Screen bragging. Was: [PROPOSAL] Don't split user visible messages across multiple lines

Paul Varner
On 03/17/2017 03:51 AM, Brian Dolbec wrote:

> On Fri, 17 Mar 2017 06:58:23 +0000 (UTC)
> Duncan <[hidden email]> wrote:
>
>> Brian Dolbec posted on Thu, 16 Mar 2017 01:08:30 -0700 as excerpted:
>>
>>>>> We could also increase the max. line length to something like
>>>>> 120 or 130.
>>>> I think more people should chime in on that. I use vertical splits
>>>> for the screen when coding, and 120 characters is too long for me,
>>>> but if the preferred width ends up changing to 120 or 130 I can
>>>> work with it.
>>>>
>>>>    
>>> You need to get some large 4K monitors... love them :D I treated
>>> myself to two 28 inch ones during boxing week sales.
>>> My aging eyes love them :)  They are so much better than my old 24
>>> inch 1080p monitors.  Those were getting tired/starting to loos
>>> clarity along with my eyes working at them all week long.  I now
>>> work with larger fonts which are still physically smaller than my
>>> old monitors, but sooooo much clearer.  My eyes don't get nearly so
>>> tired as they did with my other monitors.
>>>
>>> </bragging> ;)
>> Posting resistance failing...
>>
>> Try a 65-inch 4K with a 48-inch 1080p (now the older monitor, often
>> running youtube full-screen) off to the side. =:^)
>>
>> (They're actually TVs used as monitors via the HDMI input, no actual
>> TV hooked up.  Above about 32-inch, TVs tend to be cheaper than
>> stand-alone monitors and of course they're the same 4K high or
>> full-hd lower resolution these days.)
>>
>> Six 1280x1080 working windows three wide by two stacked on the 65"
>> 4k, still set for 96 dpi standard, FreeMono Bold 9.0 in my konsole
>> windows, yields:
>>
>> $ echo $COLUMNS x $LINES
>> 179 x 78
>>
>> And that's six of those on the 65" 4K, PLUS the full-screen 1080p
>> youtube or whatever window on the 48". =:^)
>>
>> This is the first time I can honestly say I have enough screen space
>> that most of the time I'm not actively using it all. =:^)
>>
> Yeah, I've seen lots of those types of setups.
>
> Just a few years ago when I was an A/C mechanic for my day job, I
> serviced A/C systems at numerous business's trading floors, where many
> stations ran 2 or 3 pc's mostly to house/power the video cards to
> drive 4,6, sometimes 8 monitors in a dual high setups, then numerous big
> screens overhead in various places around the floor...
>
> I don't think I could handle the large ones like you have, my eyes
> haven't got the focal range for that anymore.  As it is, I recently had
> to pull my monitors closer about 8 inches because my eyes were getting
> too tired by the end of the week.  They were just too close to the
> limits of my eyes and glasses.
>
> I do need to get a decent video card to drive these new 4K's, then
> maybe I'll think about re-connecting the old 24 inch 1080p's back up
> to the old card too  ;)  But if I really needed more screen space, I'd
> pick up 2 more of these 4k's, 2 video cards and spin them vertical ;)
>   That could make for a great driving/flight simulator :D
>
>
Since we are off topic and I have crappy eyes that have required a
couple of surgeries. My current setup that works well is two 40" 4K TV's
set to 1080p. Doesn't give me the real estate that 4k would, but my
eyeballs love the big crisp fonts and it is more space than I had before.


Reply | Threaded
Open this post in threaded view
|

Re: [PROPOSAL] Don't split user visible messages across multiple lines

Joshua Kinard-2
In reply to this post by Brian Dolbec-3
On 03/16/2017 04:08, Brian Dolbec wrote:

> On Thu, 16 Mar 2017 09:43:08 +0200
> Alexandru Elisei <[hidden email]> wrote:
>
>> On Thu, Mar 16, 2017 at 12:32 AM, Brian Dolbec <[hidden email]>
>> wrote:
>>> That could be pretty hard to do for all messages.
>>> Especially messages with embedded data
>>>
>>>   eg:  "%s is missing %s required use flag..." % ('sys-apps/foo',
>>> 'bar')  
>>
>> For that case we could use:
>>
>>     "%s is missing %s required use flag..." % \
>>         % ('sys-apps/foo', 'bar')
>
> Yes, but that is not what I meant.  When you are searching the code for
> a message.
>
>   the message in your terminal would read
> "sys-apps/foo is missing bar required use flag..."
>
> It may not be obvious to people to break up the text to search into 2
> strings.  "is missing" and "required use flag..."  trying one, failing
> that try the other to find the code location.  Then there is the
> problem of translations moving/re-arranging the text to suit the
> language (minor I know, but still a factor to consider).
>
>
>>> I know I don't always enforce the line length for a few characters,
>>> also when clarity is more important than line length.  
>>
>> I totally agree with that.
>>
>>> We could also increase the max. line length to something like 120
>>> or 130.  
>>
>> I think more people should chime in on that. I use vertical splits for
>> the screen when coding, and 120 characters is too long for me, but if
>> the preferred width ends up changing to 120 or 130 I can work with it.
>>
>
> You need to get some large 4K monitors... love them :D
> I treated myself to two 28 inch ones during boxing week sales.
> My aging eyes love them :)  They are so much better than my old 24 inch
> 1080p monitors.  Those were getting tired/starting to loos clarity along
> with my eyes working at them all week long.  I now work with larger
> fonts which are still physically smaller than my old monitors, but
> sooooo much clearer.  My eyes don't get nearly so tired as they did
> with my other monitors.
>
> </bragging> ;)
>
>
>  My work has a 130 col limit.  With an editor at that,
> plus a wide, open files pane on the left of the editor window, I still
> have another large terminal window open to it's right with some bare
> screen real-estate patches and borders... ;)  Not to mention nearly 100
> lines of code view-able in the editor.

Not breaking the error messages across lines is now a checkpatch.pl warning in
the kernel, for the specific reason of making it easy to grep for error
messages.  You're only required to drop to the next line if, after closing the
string, there are any printk() variables needed.

So, IMHO, if the kernel does it this way now, I don't see a problem with us
doing it this way.

--
Joshua Kinard
Gentoo/MIPS
[hidden email]
6144R/F5C6C943 2015-04-27
177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943

"The past tempts us, the present confuses us, the future frightens us.  And our
lives slip away, moment by moment, lost in that vast, terrible in-between."

--Emperor Turhan, Centauri Republic

Reply | Threaded
Open this post in threaded view
|

Re: [PROPOSAL] Don't split user visible messages across multiple lines

Zac Medico-2
In reply to this post by Brian Dolbec-3
On 03/15/2017 03:32 PM, Brian Dolbec wrote:

> On Mon, 27 Feb 2017 20:33:28 +0200
> Alexandru Elisei <[hidden email]> wrote:
>
>> I was working on emerge --sync and my test repo configuration
>> generated several warning messages. Finding the exact location where
>> the warnings was generated was surprisingly difficult because the
>> message string was split across three lines due to the 80 character
>> line limit and I had to grep for different patterns until I found one
>> that matched part of a line.
>>
>> I propose that messages that are visible to the user never be split
>> across multiple lines. This is also the coding style convention used
>> by the linux kernel:
>> https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings
>>
>> If accepted, this could go in the DEVELOPING file.
>>
>
> That could be pretty hard to do for all messages.
> Especially messages with embedded data
>
>   eg:  "%s is missing %s required use flag..." % ('sys-apps/foo', 'bar')
>
>
> I know I don't always enforce the line length for a few characters,
> also when clarity is more important than line length.
>
> We could also increase the max. line length to something like 120 or 130.

Just because your monitor allows you to fit more characters on a line,
doesn't mean that you should. Try a google search for "optimal line
length for readability" and you'll find that there are more factors to
consider than monitor size. The wider the line, the more difficult it is
for the eye to find the beginning of the next line. So, you end up
wasting time just trying to find the beginning of the next line.
--
Thanks,
Zac