Jeremy Howard wrote:
> It is proposed that Perl introduce a new prefix '_', which indicates a
> placeholder. This can be used either as '_identifier', which creates a named
> placeholder, or '__', which creates an anonymous placeholder.

This is a good idea, but it has a good chance of tripping up people
that come from C++ where _foo is often used to differentiate object
attributes from methods. C programs often do similar things even though
the standard reserves underscore symbols for compiler use. (Or is it
double underscore?)

The benefit to __ is that it looks weird. People that don't know what
__ is might think to look it up before changing the code around.

What if we used &? instead of __. It uses & so people suspect that it's
related to functions. It uses ? which is obviously mnemonic for "what in
the world does this do?" The "named" placeholders could use &0, &1, &2, etc.
Not as good as naming, but if you have a curried function taking more
than a few arguments, well, all I can say is that I hope all the code you
maintain was written by ex-Fortran programmers enamored with goto.

> New programmers should easily understand

New? You're talking about "new" "easy" and "higher order functions"
in the same sentence? ;)

- Ken

Reply via email to