[Haskell-cafe] Optimal line length for haskell
MightyByte
mightybyte at gmail.com
Mon Oct 29 16:32:29 CET 2012
I also stick to a pretty rigid 78 characters. Doing so actually helps
me fit more code onto my screen at a time because I usually have two
or three columns of open files side by side. I find that I need this
more often than I need to see a single function on a page (thanks to
Haskell's traditionally small functions). But this works for single
functions as well because I can open the same file in multiple columns
at different locations in the file.
"The ideal line length for text layout is based on the physiology of
the human eye… At normal reading distance the arc of the visual field
is only a few inches – about the width of a well-designed column of
text, or about 12 words per line. Research shows that reading slows
and retention rates fall as line length begins to exceed the ideal
width, because the reader then needs to use the muscles of the eye and
neck to track from the end of one line to the beginning of the next
line. If the eye must traverse great distances on the page, the reader
is easily lost and must hunt for the beginning of the next line.
Quantitative studies show that moderate line lengths significantly
increase the legibility of text."
Web Style Guide – Basic Design Principles for Creating Website
Patrick J. Lynch and Sarah Horton
2nd edition, page 97.
On Mon, Oct 29, 2012 at 10:37 AM, Jake McArthur <jake.mcarthur at gmail.com> wrote:
> I stick to 80 columns fairly rigidly. This is not only so that it fits
> into narrow windows, but also so that any two subexpressions in the
> same expression tend to be close together on my screen, which makes it
> easier for me to reason about it. If only it was easy for me to read
> and write code on a Hilbert curve... :)
>
> I don't think long lines indicate a design problem; it's solely a
> formatting thing.
>
> On Mon, Oct 29, 2012 at 7:50 AM, Rustom Mody <rustompmody at gmail.com> wrote:
>> There was a recent discussion on the python list regarding maximum line
>> length.
>> It occured to me that beautiful haskell programs tend to be plump (ie have
>> long lines) compared to other languages whose programs are 'skinnier'.
>> My thoughts on this are at
>> http://blog.languager.org/2012/10/layout-imperative-in-functional.html.
>>
>> Are there more striking examples than the lexer from the standard prelude?
>> [Or any other thoughts/opinions :-) ]
>>
>> Thanks,
>> Rusi
>>
>>
>>
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
More information about the Haskell-Cafe
mailing list