652
functions
(lemmy.nz)
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Kotlin also lets you do
fun x() = y()I have no idea why you'd need that especially since return y() is pretty easy, but... I want it!
(Actually, I guess a super simple way of overloading a method, like fun x() = x(defaultValue) could be neat)
default values is one of my pet-peeves after using Python regularly. I wish more languages would let you just do something like
def do_thing(arg=default_value)without hoops like builder pattern, function overloading, or whatnot(Kotlin does support that, with the same
fun do_thing(arg: Int = 2)syntax.)