« Return to Thread: Good Haskell Style

Re: Good Haskell Style

by Simon Marlow-5 :: Rate this Message:

Reply to Author | View in Thread

Ian Lynagh wrote:

> * Don't leave trailing white space in your code
> * Don't use tabs
> * Aim to keep lines under 80 characters
> * Use the CamelCase variable naming convention
> * Don't use explicit braces and semicolons

I'm with you all except for the 4th one:

 > * Use the CamelCase variable naming convention

I'm rather attached to the convention I use, which is

   - CamelCase for exported identifiers
   - underscores otherwise

(I'm pretty sure I don't use it consistently, so don't bother to dig up
counter-examples though).

Why do I like this?  Ideally we'd have an IDE which would colour my
exported identifiers differently, but since I don't use such an IDE the
CamelCase distinction gets some of the benefit.  CamelCase for exported
identifiers is already an established convention (which should really be
part of a library API style guide), which leaves us with underscores for
local identifiers.

Yes I'm aware that a single-word identifier is the same in both
conventions; it's not perfect.

Cheers,
        Simon
_______________________________________________
Libraries mailing list
Libraries@...
http://www.haskell.org/mailman/listinfo/libraries

 « Return to Thread: Good Haskell Style