Boost logo

Boost :

Subject: Re: [boost] coding conventions
From: Patrick Horgan (phorgan1_at_[hidden])
Date: 2010-01-04 15:57:20

Stewart, Robert wrote:
> Paul A. Bristow wrote:
>> Mateusz Loskot wrote:
>> ... elision by patrick...
>> Perhaps we should relax the 80 char width recommendation?
>> (and anyway it is only a recommendation? - Readability comes
>> first?)
> I constrain my code to 80 columns and have no problems with readability, though I can imagine those used to long lines might. Long lines are quite difficult to read in my preferred editor configuration. A highly subjective criteria like readability is troublesome as justification for relaxing the width restriction.
And it doesn't make any sense. Books constrain themselves to about 60
columns because much more than that and readability suffers. I
understand and share the frustration of having to break lines up, but I
can tell you from my own experience, (and I'm sure I'm not unusual in
this), that reading code with long lines takes a lot longer to figure
out and understand, even when I make my screen wide enough. There's
something about having all the information in one field of view that
works for human beings. There's been a lot of usability research to
back this up.
> Using proportional fonts increases the opportunity for text to exceed a given screen width depending upon the viewer's selected font. One person using a small or tight proportional font and a high screen resolution or large screen will easily exceed the screen width of another person using a looser or larger font or a screen with lower resolution or smaller width. Using 80 columns as the limit ensures that regardless of the font, it will fit on any developer's screen and the printed page without wrapping or truncation.
> I happen to like arranging two buffers (file views) side-by-side in a single window and often have two such windows up at once (dual monitors). That allows me to have as many as four 80-column files visible at once. There are other configurations and not everyone does what I do, but the point of the Guidelines is "Boost's widely distributed source code should follow more conservative guidelines."
I do the same, great for cut and paste, or for looking at a header and a
source file.
>> PS Using 2 space indentation reduces the risk of running over
>> the 80 width, so is my preference.
> Some find two too small to visually align vertically, but four limits indentation depth, so we've used three for years. (Gasp! Yes, three isn't a power or multiple of two, but it works well.)
I like four for source, but oddly two for lilypond source. (And as a
strange aside, though I thought I'd morphed quite a bit over the years,
a recent re-reading of an ancient copy of K&R pointed out that I'd
STRONGLY imprinted on their style. My code still looks just like
theirs! LOL!)


Boost list run by bdawes at, gregod at, cpdaniel at, john at