[Haskell-cafe] Why shouldn't variable names be capitalized?

Udo Stenzel u.stenzel at web.de
Fri Aug 4 17:15:46 EDT 2006


Martin Percossi wrote:
> Paul Hudak wrote:
> >foo x y = ...
> >
> >We know that x and y are formal parameters, whereas if they were 
> >capitalized we'd know that they were constructors.
> 
> I agree that naming can be abused. But I think it should be *me* ...

Oh, you like to decide lexical ambiguities.  Well, I suppose you know a
bit of C++.  So what do you think this is:

*> int *foo ;

It's the declaration of a pointer to 'int' named 'foo', isn't it?  now
what's this:

*> x * y ;

*Obviously* this mulplies x and y and throws the result away, doesn't
it?

Now look more closely.  Do you see it?  Or does it get more blurred the
closer you look?  We don't have this problem in Haskell, and in a sane
world, C++ shouldn't have it either.

If you find second-guessing the programmer funny, try to write a parser
for C++.  You will have so much fun, it's almost impossible to describe.


Udo.
-- 
Even if you're on the right track, you'll get run over if you just sit there.
                -- Will Rogers
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org//pipermail/haskell-cafe/attachments/20060804/6b41973c/attachment.bin


More information about the Haskell-Cafe mailing list