[Haskell-cafe] About code style ?

Erik de Castro Lopo mle+hs at mega-nerd.com
Mon Feb 1 21:37:44 EST 2010


zaxis wrote:

> For me i like C style instead of layout. For example, 
> func1 a = do
>      -- ...
>      a * 2
>      -- ...
> 
> I always write it as:
> func1 a = do {
>   -- ...;
>    a * 2;
>   -- ...;
> }

Honestly, don't do this.

When you're coding in Haskell you should write idiomatic Haskell and when
doing C, do idiomatic C.

Inventing your own coding style for a language will make it difficult for
other people who know and use that language to read your code and sooner
or later you will want to or need to work with others.

Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/


More information about the Haskell-Cafe mailing list