News for hackers. Stuff that matters.
Re:Revisiting Java in 2021 – Part II by rnentjes on Sunday September 19, 2021 @01:10PM (#28585980)
Alternative way to count the vowels in Kotlin:

    val numVowels = countVowels(getDTO()?.string ?: "")
Re:Revisiting Java in 2021 – Part II by ptx on Sunday September 19, 2021 @01:39PM (#28586232)
Or alternatively, closer to the original, doing both null checks the same way the original does the first one:

  val numVowels = getDTO()?.string?.let(::countVowels) ?: 0