[Haskell-cafe] Re: Allowing hyphens in identifiers

Johannes Laire johannes.laire at gmail.com
Fri Dec 11 05:37:13 EST 2009


On Thu, Dec 10, 2009 at 12:54 AM, Richard O'Keefe <ok at cs.otago.ac.nz> wrote:
> Given the amazinglyUglyAndUnreadably baStudlyCaps namingStyle that
> went into Haskell forNoApparentReasonThatIHaveEverHeardOf

Compare:

someCoolFunc fstParam sndParam fooBarBazQuux
some_cool_func fst_param snd_param foo_bar_baz_quux

In the first one, it's easy to see that there are 4 identifiers. But,
at least for me, the second one is significantly harder to read;
spaces and underscored are too similar. So, while underscores more
clearly separate words in a single *identifier* and make it easier to
read, in some cases I think they make *code* with many identifiers
harder to read for exactly the same reason.

In languages where function application looks like "f(x,y,z)" instead
of "f x y z" this isn't a problem and I often use underscores.

-- 
Johannes Laire


More information about the Haskell-Cafe mailing list