public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org
Cc: gcc@gcc.gnu.org
Subject: [RFC] Increase libstdc++ line length to 100(?) columns
Date: Thu, 26 Nov 2020 23:50:57 +0000	[thread overview]
Message-ID: <20201126235057.GQ1312820@redhat.com> (raw)

I've touched on the subject a few times, e.g.
https://gcc.gnu.org/pipermail/gcc/2019-December/230993.html
and https://gcc.gnu.org/pipermail/gcc/2019-December/231013.html

Libstdc++ code is indented by 2 columns for the enclosing namespace,
usually another two for being in a template, and is full of __
prefixes for reserved names. On top of that, modern C++ declarations
are *noisy* (template head, requires-clause, noexcept-specifier, often
'constexpr' or 'inline' and 'explicit', and maybe some attributes.

All that gets hard to fit in 80 columns without compromising
readability with line breaks in unnatural places.

Does anybody object to raising the line length for libstdc++ code
(not the rest of GCC) to 100 columns?

Please read my replies in the thread linked above before telling me
that the code should be split up into smaller functions to avoid deep
nesting. The function I pointed to cannot easily be split up without
making the code slower to compile and potentially slower to run:
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libstdc%2B%2B-v3/include/bits/stl_algobase.h;h=a2fd306e6d0cca579b510148ba1a7089e2b2f3a2;hb=HEAD#l1499


             reply	other threads:[~2020-11-26 23:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26 23:50 Jonathan Wakely [this message]
2020-11-27  2:45 ` Liu Hao
2020-11-27  8:14   ` Richard Biener
2020-11-27  8:21     ` Ville Voutilainen
2020-11-27  9:49     ` Liu Hao
2020-11-27 10:13       ` Ville Voutilainen
2020-11-27 11:08 ` Allan Sandfeld Jensen
2020-11-29 17:38   ` Florian Weimer
2020-11-29 18:51     ` Allan Sandfeld Jensen
2020-11-30 15:47       ` Michael Matz
2020-11-30 16:28         ` Allan Sandfeld Jensen
2020-11-30 16:44           ` Michael Matz
2020-12-03 12:11     ` Richard Earnshaw
2020-11-27 21:46 ` Ed Smith-Rowland
2020-11-28 12:16 ` Thomas Koenig

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=20201126235057.GQ1312820@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /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).