[Haskell-cafe] Optimal line length for haskell
rustompmody at gmail.com
Mon Oct 29 17:44:07 CET 2012
On Mon, Oct 29, 2012 at 7:58 PM, Alexander Solla <alex.solla at gmail.com>wrote:
> On Mon, Oct 29, 2012 at 6:52 AM, Michael Orlitzky <michael at orlitzky.com>wrote:
>> On 10/29/2012 07:50 AM, Rustom Mody 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
>> > 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
>> > [Or any other thoughts/opinions :-) ]
>> 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)
Interesting points. In fact my wish for using (when appropriate) a wide
form is related to some hunch about this 'wide normal form'
Can you throw some light on how one may understand that phraset?
Also BTW Ive cleaned up the post again. Since my ineptitude with blogger
was looking like an ineptitude with haskell (which may well be there and
more :-) ) Ive moved the wide code to gist.
I believe the code examples speak differently in this new format
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe