Hacker News new | ask | show | jobs
by btilly 5101 days ago
I hate pointless pedantry which is all that this discussion is.

Anyways anonymous function syntax is not always terse. So if terseness is the point, then it is a pointless distinction. Consider JavaScript. I am sure that you'd agree that the following is an anonymous function (Wikipedia certainly agrees that it is):

  function (x, y) {
    return x + y;
  }
But that is not very terse, is it? Even declaring a named function in Haskell is more terse than that by far. (And that anonymous function could just be: \x y -> x + y) But it is unambiguously an anonymous function syntax.

Anyways from the point of view of a programmer, what matters most is what you can say, and then secondly how convenient it is to say it. Anything that you would want to say with anonymous functions, you can say in Python. It will be more verbose by far than a real functional language like Haskell would be. But not really worse than many other scripting languages, like JavaScript.

1 comments

But it's definitely worse than a scripting language like ruby.

Also, by this definition, the OP is just adding terseness to Java, not lambdas or anonymous functions.