gnu-c++-standards
[Top][All Lists]
Advanced

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

C++ code indentation for GNU


From: James Youngman
Subject: C++ code indentation for GNU
Date: Sat, 13 Jul 2019 09:17:14 +0100

The GNU project has a recommended style for code layout in C.   In
case you don't have it to hand, it's at
https://www.gnu.org/prep/standards/html_node/Formatting.html#Formatting.
  I think it's worth noting that it is just a recommendation.   I
quote:

> We don’t think of these recommendations as requirements, because it causes no 
> problems for users if two different programs have different formatting styles.

> But whatever style you use, please use it consistently, since a mixture of 
> styles within one program tends to look ugly. If you are contributing changes 
> to an existing program, please follow the style of that program.

In the same spirit, I'd like to discuss how C++ code should be laid
out in GNU.   As I'm sure you've found before, discussion of code
layout can give rise to immense amounts of bike-shedding.   Hence I'd
like to propose a somewhat narrow scope for this discussion:

1. I'd like to retain the spirit of the GNU C style rules.   I'd
prefer not to change things for the C++recommendations which would
imply changes to the C recommendations for the sake of consistency.
2. I'd like it to be possible to update GNU tooling (e.g. Emacs' C++
mode, perhaps GNU indent).   Maybe that means helping make those
changes, or just ensuring that our recommendations are clear and
specific, with examples.
3. I'd like us to consider how our recommendations would likely be
received by GNU contributors generally. Making recommendations that
are widely ignored would be a waste of time.

Thanks,
James.



reply via email to

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