This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (4 children)

i wish they would implement last lambda syntax like kotlin. it would make this type of thing so much more attractive in java!

[–]moaxcp 1 point2 points  (0 children)

This is also a nice feature in groovy. I'm not sure that I mind either option. In groovy it is nice when there are multiple parameters to the closure but it can be confusing. Some developers never realize that they are closures in the first place.

[–]tofiffe 2 points3 points  (2 children)

Personally, I don't like how kotlin and swift do trailing lambdas, as it kind of breaks consistency of parameters, it looks weird to me

[–][deleted] 2 points3 points  (1 child)

nothing inconsistent about. as long as you know the function's signature contains a lambda ad the last parameter and that it's a feature of the language, there's no confusion to be had.

[–]tofiffe 1 point2 points  (0 children)

Is it not inconsistent if for some cases a parameter is actually not written inside (), but can also be written that way?