To K&R or not

Molle Bestefich molle.bestefich at gmail.com
Fri Jun 2 12:45:09 CDT 2006


EA Durbin wrote:
> >K&R style brack placements
>
> They are an eyesore and make things difficult to read.

Highly subjective.

I think K&R has distinct advantages, namely it unites the scope begin
token with the relevant control statement.  For me, this makes code
easier and faster to read, since I can follow the indentation and
arrive immediately at the relevant control statement.

Also I think that K&R is nice in that it saves screen real estate,
which again for me makes code easier to read because I can see more of
it at once.  I personally consider non-K&R style an eyesore because of
this.

CMIIW, but the only thing that non-K&R has going for it is that you
can visually make out whether you've made the correct number of
opening versus closing braces.  I don't think that's much of an
advantage, especially considering that any modern source code editor
will highlight the starting brace or relevant control statement for
you.


That said, I don't care what people do, I can read both...
In my perfect world though, my SCM client would convert source code to
my preferred format on checkout, and to whatever universal format the
repository uses on checkin.  Ho hum...



More information about the wine-devel mailing list