[Haskell-cafe] Optimal line length for haskell

Mike Meyer mwm at mired.org
Mon Oct 29 14:10:31 CET 2012



Colin Adams <colinpauladams at gmail.com> wrote:

>I'm not viewing on a narrow device, and I see the wrapped (and the
>whole
>post confined to the centre of the screen).
>
>I certainly don't use an 80-column limit any more. I use the rule:
>
>A function must be completely visible in my editor on my screen. (but
>this
>is only a good rule if most people who will be reading the code will
>also
>have a similar sized viewport. After all, code is far more often read
>than
>written.)

I don't think "similar sized viewport" begins to cover it.  If the editor wraps long lines, then the lines will always be visible, no matter how long they are. Of course, lines wrapped around to the beginning of the next line in indented code are really, really ugly, so I'd prefer to avoid that. 

This is one of the cases where it's more important that there be a standard than what the actual value is. Personally, I like  roughly 80 columns, but I've been dong this long enough to have used the things that the 80-column console format was copied from. That screens are now bigger isn't really relevant. They are also windowed - no matter how hard Windows, Linux and Mac apps try and pretend they own the entire screen - and multitasking, so it's unreasonable to format code as if the editor were going to be the only visible window.

On the other hand, readable cross-platform text formatting always seems to be a lost cause, as this mail and the referenced blog posting demonstrate.
-- 
Sent from my Android tablet with K-9 Mail. Please excuse my swyping.



More information about the Haskell-Cafe mailing list