This might be an excessive use of Kotlin, but of t...
# codereview
s
This might be an excessive use of Kotlin, but of the three examples, which would you rather go with? 1️⃣
Copy code
val channel = payload.obj("channel")?.string("id")
val userId = payload.obj("user")?.string("id")
val text = payload.obj("message")?.string("text")
val responseUrl = payload.getString("response_url")
2️⃣
Copy code
val (channel, userId, text, responseUrl) = payload.run { listOf(
    obj("channel")?.string("id"),
    obj("user")?.string("id"),
    obj("message")?.string("text"),
    getString("response_url")
)}
3️⃣
Copy code
val (channel, userId, text) = payload.run { Triple(
    obj("channel")?.string("id"),
    obj("user")?.string("id"),
    obj("message")?.string("text")
)}
val responseUrl = payload.getString("response_url")
1️⃣ 5