public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Michael Matz <matz@suse.de>
Cc: Thomas Schwinge <thomas@codesourcery.com>,
	"gcc@gcc.gnu.org" <gcc@gcc.gnu.org>,
		gcc-patches <gcc-patches@gcc.gnu.org>,
	"fortran@gcc.gnu.org List" <fortran@gcc.gnu.org>
Subject: Re: [RFC] Characters per line: from punch card (80) to line printer (132) (was: [Patch][OpenMP/OpenACC/Fortran] Fix mapping of optional (present|absent) arguments)
Date: Thu, 05 Dec 2019 17:03:00 -0000	[thread overview]
Message-ID: <CAH6eHdRxXmjv5w7QzQwwqez4f46rAL417v9tfoyyAauVBP1eFg@mail.gmail.com> (raw)
In-Reply-To: <alpine.LSU.2.21.1912051634470.24095@wotan.suse.de>

On Thu, 5 Dec 2019 at 16:44, Michael Matz <matz@suse.de> wrote:
>
> Hello,
>
> (oh a flame bait :) )
>
> On Thu, 5 Dec 2019, Thomas Schwinge wrote:
>
> > So, I formally propose that we lift this characters per line restriction
> > from IBM punch card (80) to mainframe line printer (132).
> >
> > Tasks:
> >
> >   - Discussion.
>
> I object to cluttering code in excuse for using sensible function names or
> temporaries that otherwise can help clearing up code.  Using 132-char
> lines is cluttering code:
> - long lines are harder to read/grasp: vertical eye movement is easier
>   than horizontal, and source code should be optimized for
>   reading, not writing
> - long lines make it impossible to have two files next to each other at a
>   comfortable font size
> - long lines are incompatible with existing netiquette re emails, for
>   instance
>
> So, at least for me, that my terminals are 80 wide (but not x24) has
> multiple reasons, and the _least_ of it is because that's what punch cards
> had.

C++17 introduces a nice feature, with rationale similar to declaring
variables in a for-loop init-statement:

if (auto var = foo(); bar(var))

The variable is only in scope for the block where you need it, just
like a for-loop.

Unfortunately nearly every time I've tried to use this recently, I've
found it's impossible in 80 columns, e.g. this from yesterday:

    if (auto __c = __builtin_memcmp(&*__first1, &*__first2, __len) <=>
0; __c != 0)
      return __c;

When you're forced to uglify every variable with a leading __ you run
out of characters pretty damn quickly.

I can either not use the feature (and have the variable defined in a
larger scope than it needs to be) or add fairly arbitrary line breaks:

            if (auto __c
            = __builtin_memcmp(&*__first1, &*__first2, __len)
            <=> 0; __c != 0)
              return __c;

or try to give the variables shorter (and less meaningful) names.
Adding line breaks or picking shorter names doesn't help readability.
So I end up not using the feature.

I'm loosely in favour of relaxing the rule for libstdc++ code. I don't
really care what the rest of GCC looks like ;-)

  reply	other threads:[~2019-12-05 17:03 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8be82276-81b1-817c-fcd2-51f24f5fe2d2@codesourcery.com>
     [not found] ` <20191205151515.GS10088@tucnak>
2019-12-05 15:47   ` Thomas Schwinge
2019-12-05 16:04     ` Jakub Jelinek
2019-12-05 20:21       ` Segher Boessenkool
2019-12-05 16:17     ` Joseph Myers
2019-12-05 16:24       ` Paul Koning
2019-12-05 16:40         ` Jeff Law
2019-12-05 16:55         ` [RFC] Characters per line: from punch card (80) to line printer (132) Florian Weimer
2019-12-05 17:55       ` Andrew Stubbs
2019-12-05 18:12         ` Eric Gallager
2019-12-05 18:22         ` Robin Curtis
2019-12-05 19:16           ` James Secan
2019-12-06  9:22           ` Andrew Stubbs
2019-12-05 16:44     ` [RFC] Characters per line: from punch card (80) to line printer (132) (was: [Patch][OpenMP/OpenACC/Fortran] Fix mapping of optional (present|absent) arguments) Michael Matz
2019-12-05 17:03       ` Jonathan Wakely [this message]
2019-12-05 18:07         ` Marek Polacek
2019-12-05 20:06         ` Segher Boessenkool
2019-12-05 20:38           ` Marek Polacek
2019-12-05 22:02             ` Segher Boessenkool
2019-12-05 20:56           ` Jonathan Wakely
2019-12-05 22:19             ` Segher Boessenkool
2019-12-05 22:34               ` Jonathan Wakely
2019-12-05 22:37               ` Jonathan Wakely
2019-12-05 23:02                 ` Segher Boessenkool
2019-12-05 17:29       ` N.M. Maclaren
2019-12-05 20:12       ` Segher Boessenkool
2019-12-05 20:41       ` Jason Merrill
2019-12-05 18:54     ` [RFC] Characters per line: from punch card (80) to line printer (132) Martin Sebor
2019-12-05 20:32       ` Segher Boessenkool

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH6eHdRxXmjv5w7QzQwwqez4f46rAL417v9tfoyyAauVBP1eFg@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=matz@suse.de \
    --cc=thomas@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).