https://kotlinlang.org logo
#announcements
Title
# announcements
s

sreich

02/13/2017, 10:06 AM
Again, you're arguing preference. A fruitless discussion
r

robin

02/13/2017, 10:15 AM
sreich: It might be partly preference, but I would argue that you should have a good reason to do anything that deviates from the standard way of doing things, be it better readability, better performance, less typing or something else, but I see none of that in your
finish
-function.
s

sreich

02/13/2017, 10:15 AM
It's not that dissimilar from .use {}
Which really does the same thing but behind the scenes
Though I think I would prefer to create more specific extension functions like use, for classes that require that
👍 2
r

robin

02/13/2017, 10:18 AM
It has some similarity, but
use
actually adds value by hiding that hideous try...finally construct.
use
is more readable compared to the standard way, and it's quicker to type.
6 Views