This is the mail archive of the gcc@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: Convert 3.2 sources to ISO C90


On Fri, Jun 07, 2002 at 10:57:10AM +0100, Richard Sandiford wrote:
> Nathanael Nerode <neroden@doctormoo.dyndns.org> writes:
> > Just allowing ordinary ISO prototypes, and defining function
> > arguments ISO-style, would add a lot of readability.  There's a *reason*
> > ANSI choose to do things the way they did; it's *inherently* more
> > readable than the K&R syntax,
> 
> _Inherently_ more readable?  It's a personal thing as much as any other.
> Michael Matz has already said he finds the K&R style more readable, and
> I have to say I do too.  I realise we're outnumbered, though.  ;)

My main complaint with K&R style is that the declarations of the
(types of the) parameters are too similar to the declarations of local
variables.  Well, actually, they're identical, I think. :-)  Great for
obfustication.  It makes function signatures potentially tricky to find 
(since parameters can have their types specified in funny orders),
as opposed to self-evident.  Admittedly, good stylistic pratcice avoids
this.

Personally I like a formatting style for function parameters which gives
each parameter its own line within the parentheses.  I then tend to add 
a comment up top with a typical invocation, so you can see what it
looks like without all those types... by this point I've
duplicated many of the virtues of the K&R style.  Hmm.  ;-)

--Nathanael


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