8

Sometimes code is correct but so wrong. Came across this in a kotlin PR today

If (thing != null && thing!!.field != null) {

Comments
  • 2
    The above works but does my head in. Just do this

    If (thing?.field != null) {

    So many problems like this where sure the longer one works but it's ugly and more annoying to understand
  • 1
    I hate kotlin and I find it just as annoying as Java, but even I wouldn’t do that.. must be an intern?
Add Comment