Expected distribution of lambda sizes (Re: Syntax poll, take 2)

Reinier Zwitserloot reinier at zwitserloot.com
Thu Jun 16 00:03:41 PDT 2011


On Tue, Jun 14, 2011 at 7:55 PM, Llewellyn Falco <isidore at setgame.com>wrote:

> "THERE IS NO JOE JAVA"
>

There is certainly such a thing as 'the majority of java programmers use
this style'. For example, the (vast) majority of java programmers will very
quickly brace up the body of an if/for/while statement. When I say "Joe Java
appears to dislike long one-liners", that's what I'm referring to. More
formally:

Using the apparent aggregate preferences of the greater java community, as
gleaned by looking at a lot of open source code, I conclude that the greater
java community will likely end up putting a lot more linebreaks in closure
bodies than we are doing with these examples.

Another thing we can conclude by looking at a lot of existing java code is
that `students.filter(s => s!=null && "Smith".equals(s.getName()))` is nice,
but Stephen's much longer if-statement based body is equally if not more
likely.  There's a fine line between catering to idiots and being realistic
about code quality, but in this case the more general conclusion is that a
considerable chunk of filter/map usecases can't (easily) be golfed down to a
single expression. I believe that to be a fair assessment.


More information about the lambda-dev mailing list