[Haskell-cafe] Optimal line length for haskell

Michael Orlitzky michael at orlitzky.com
Mon Oct 29 16:06:43 CET 2012


On 10/29/2012 10:28 AM, Alexander Solla wrote:
> 
>     In any language, a line longer than 80 characters usually (but not
>     always) suggests that you might want to stop and rethink your design. In
>     many cases a refactoring or two will greatly simplify the code and
>     reduce your line length as a result.
> 
> 
> I disagree.  That might be true for imperative languages, where width is
> indicative of deep nesting and its associated problems.  But it is not
> true for a functional language, where it is merely indicative of a wide
> "normal form".  Yes, the normal form can sometimes be refactored, but to
> what end?  You might easily end up refactoring out of the level of
> abstraction you actually want.  Or the wide form might have useful
> properties, like the ability to sort the lines of source code
> alphanumerically (which would be lost if you switched to a stanza-based
> format)

Well, I did leave the door open for special cases with "usually (but not
always)." I know I've had to go over 80 chars before with huge constants
or long test names.

If you're willing to sacrifice maintain/readability for some other
property (e.g. source code sortability), then I don't think my point
applies.



More information about the Haskell-Cafe mailing list