Hacker Newsnew | comments | show | ask | jobs | submit login

Frankly, I'd prefer:

    %1 + %2 * 2
Over:

    _ + _ * 2
With the former syntax, it's much more obvious what the function is doing.



Why?

-----


Because _ and _ refer to two different values using the same name. Adding a third _ would refer to yet another value, etc.

-----


Not to be excessively glib, but I can't resist pointing out that children successfully comprehend this notation daily, it's called "fill in the blank."

-----


It's not a matter of it not being comprehensible once you know what's going on; it's a matter of consistency with the rest of the language. Everywhere else, each symbol refers to one and only one value within a given lexical context. Breaking from that expectation would require some compelling benefits.

-----


Well, does it mean:

    (x, y) -> x + y
Or:

    (x) -> x + x
If I didn't know the language, I'd assume the latter, so it fails the principle of least surprise (at least for me).

-----




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: