Is 78 characters still a good option? Was: [Haskell-cafe] breaking
too long lines
wren ng thornton
wren at freegeek.org
Tue Apr 21 22:37:00 EDT 2009
Dusan Kolar wrote:
> Dear all,
> reading that
> > according the several style guides, lines shouldn't be too long
> > (longer than 78 characters).
> > http://www.cs.caltech.edu/courses/cs11/material/haskell/misc/haskell_style_guide.html
> > http://www.haskell.org/haskellwiki/Programming_guidelines
> I would like to know, whether 78 characters bound still makes a sense...
> Even if I connect to my linux box with text terminal, it is not a 80x24
> characters HW text terminal, but a window emulating this in whatever
> else OS, thus, I can usually extend this to see longer lines easily.
> Or is the reason much deeper? Or, is the bound set to 78 characters just
> because it is as good number as any other?
There is a deeper reason. Much work in typography has shown that humans
read text best when it's around 76 characters wide; if things get
narrower than that then cohesion is lost, if things get wider then it
takes a long time to acquire the beginning of the next line. This is the
reason why newspapers and magazines are designed with columns at the
width they are, why the unix fmt tool has the default settings it does,
why mail readers (e.g. Thunderbird) autowrap around there, etc...
The historical 80x24 terminal is often cited as the reason for the ~80
character limit, and is as often disparaged as it is praised in light of
modern displays (does huge display => many windows, or huge display =>
one huge window?). But regardless of technical capabilities, there is a
cognitive issue at stake. Naturally, code /= text, but there are many
similarities; I'm not aware of any HCI studies contrasting them in terms
of cognitive load at different widths however.
More information about the Haskell-Cafe