PBP: 001 Bracketing

The PBP suggests the venerable K&R bracer style.  I don’t have a strong feeling on this.
I have used several styles over the years, and mildly prefer the Allman style, which the book calls BSD.  I find the GNU style of half-indents bizarre.

The argument that K&R saves a line doesn’t seem as relevant as it used to, in this day of 27″ monitors.  I do find the extra vertical separation makes scanning code easier, but not enough to argue over.  I like whitespace, and find highly dense code hard to read.

K&R is a widely used choice in the Perl community, and the tips on how to scan for the breaks in the book can help make it more accessible to people who are used to the Allman/BSD style.  I’ve gotten used to this for Perl.

Leave a Reply