<https://blog.simon-wirtz.de/the-power-of-gradle-k...
# feed
v
The
let
function cried when you used it like this, but other than that, a very good post! Updated my build scrips 😉
s
What would you do instead of
let
?
Thanks for feedback!
v
I would make a local
val
- all the benefits, non of the confusion
My rule is that code should read as an english phrase. Example:
list.let { print(it) }
s
Okay I see. That’s the problem when we have so many possibilities I guess. A local
val
is totally perfect too! I don’t think
let
is abused in the example though
v
Maybe my mistake is trying to find a healthy meaning in the names of functions like
let
and
apply
. I wonder what the guy that invented those thinks 😆
s
Yes I also have problems with the names sometimes, would be interesting to know why! Actually I would use
with
instead, but it would make the example worse
2
i
@voddan
let
is a "scope"-function and here it is used exactly to limit the scope of
v
variable for vertx dependencies only
g
maven { url = uri(it) }
can be replaced with
maven(it)
or
maven(url = it)
if you want to be more explicit.
v
@ilya.gorbunov hm, why is it called
let
then? It could be called
scope
or something