[Haskell-cafe] Readable Haskell

Ignat Insarov kindaro at gmail.com
Mon Sep 21 20:39:29 UTC 2020


> What you and Mr. Torvalds forget is that there is a reason why
> newspapers are written in relatively small columns. Even scientific
> papers are often printed in two column mode. Typesetting has been done
> since a few 100 years and has for the most time been an analog
> technique, so it mostly wasn't limited by available resolution. The
> point is that humans aren't good at reading text when the line length
> exceeds roughly 80 characters because when you jump from the far right
> to the far left of the text, it gets hard to correctly identify where
> the next line starts. A value of 60 is ideal for non-indented text. Thus
> considering indentation that is not too deep, say (usually) not
> exceeding 5 levels a 4 spaces makes 20 chars, which means max. line
> length is ideal at 80 and should not exceed 100 (or 90 with 2 spaces for
> indentation).
>
> I can view files in fullscreen mode if forced to do so by the author of
> the code but I hate it. This has nothing to do with being old-school.

This is a fair objection. Absurdly long lines are uncomfortable. In defense, we
have:
- Syntax highlighting.
- Blank lines.
- Indentation.
- Ragged right edge.
- Infinite canvas.

This makes lines multiform, so losing the line seems less likely. Further, code
is not read like prose — you skim much more, the zig-zag pattern of the usual
reading is gone. It seems to me that all this together gives enough freedom that
shortening identifiers is not a necessity anymore.

I am not aware of any research that substantiates this opinion though.

> >> When I tile my terminal windows on my display, I can have 6 terminals
> >> visible at one time, and that's because I have them three wide. And I
> >> could still fit 80% of a fourth one side-by-side.
>
> Using a laptop with max. 15 inch display? How old are you? People over
> 50 years or so usually have trouble reading such small print, no matter
> how great the resolution. So (apart from the arguments above) screen
> size often limits how much text can be displayed in a readable fashion.

Linus Torvalds is exactly 50. In any case, this is all adjustable. I zoom in
when my eyes are tired.


More information about the Haskell-Cafe mailing list