This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: An abridged "Writing C" for the gcc web pages


On Tue, 3 May 2016, Richard Sandiford wrote:

> And sometimes there are multiple acceptable ways of writing the same code.
> Which wins is an aesthetic choice, which tools tend to be bad at handling.
> E.g. if a parameter list is too long for a line, there's often a choice
> of how to balance the parameters across multiple lines, with some being
> more readable than others.  I wouldn't want the one chosen by a formatting
> tool to be the only acceptable one.

 I'd call that a bug in the tool.  It shouldn't be switching between valid 
formatting styles unless explicitly asked to, even if the formatting style 
seen is not one the tool would itself produce from badly formatted code.

> And sometimes people split "if" conditions over multiple lines even when
> they would fit on one line, since the split version seems more readable.
> Again I wouldn't want a tool to be the final judge of which is right.

 Like the above -- as long as it's correct it should be left alone even if 
it's "suboptimal".

 FWIW,

  Maciej


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]