Is there a form more idiomatic than other between ...
# announcements
y
Is there a form more idiomatic than other between
someList.map(::Foo)
and
someList.map { Foo(it) }
?
c
Not really, choose whichever you like best.
s
I hardly ever use the
::Foo
form. The latter applies in more cases so it is annoying to convert between the two while writing code.
y
Thanks.
r
I prefer the former (
::foo
) as I feel it gives a better high level explanation of what's going on. You don't need to waste the extra brain cycles considering the specifics of the parameters as well since they don't really tell you anything useful in this case. But to each their own 🙂