https://kotlinlang.org logo
Title
l

LeoColman

06/10/2020, 7:08 PM
when I can just use trivial methods from standard library:
And also, in my opinion, this is a very weak argument. Why bother using Kotlin if you can write things trivially in Java? Why bother using Java if you can write things trivially in C?
🥇 1
a

Alex Kuznetsov

06/10/2020, 7:38 PM
Re:
Why bother using Kotlin if you can write things trivially in Java?
because I am several times more productive with Kotlin. A smallish effort to learn it pays off in a few days. With
"substring".shouldContain("str")
I am just as productive as with
assertTrue("substring".contains("str"))
and I've spent/wasted some time to learn it. Not worth it, for trivial cases at least.
l

LeoColman

06/10/2020, 7:42 PM
just as productive as with
Perhaps when writing 10 assertions. Reading them again after some time is what really bites you
Even for simple cases. Every extra
.
, every extra word, every extra `()`makes a lot of difference when the time passes
a

Alex Kuznetsov

06/11/2020, 8:12 PM
yes
withClue("Name should be present") { user.name shouldNotBe null }
is clearly much shorter than `assertTrue(user.name.isNotNull(), "Name should be present") `` of course kotest might have lots of advantages, but is it really terse?