30 Jun 2019
I’ve been listening to an (and another) excellent podcast by Clojure programmers recently and learned that nobody builds classes in Clojure; and certainly not to represent data. Instead they populate maps for all the uses where Kotlin developers would reach for a data class.
I’ve got very used to data classes and like them a lot, but there are certainly situations in which they don’t shine. Today I’m going to look using maps instead.
The Brief
Let’s...
20 Jun 2019
Nat Pryce and I have been asked to run our popular Refactoring to Kotlin Workshop at KotlinConf 2019 in Copenhagen.
If you are attending the conference but relatively new to the language it is an excellent way to get up to speed on the language and its idioms.
More Details
19 Jun 2019
This is Part 7 in a series looking at functional error handling in Kotlin. The parts are
Today I’d like to talk about avoiding error handling.
If...
16 Jun 2019
This is Part 6 in a series looking at functional error handling in Kotlin. The parts are
It has been over a year since I wrote Part...
06 Jun 2019
Say you have a function
fun sum(x: Int, y: Int) = x + y
and for some reason you suspect that it is going wrong. You’d like to print the return value to the console. So you extract the expression to a variable, print it, and return it.
fun sum(x: Int, y: Int): Int { val result = x + y println(result) return result }
Hmmm, for a temporary change, that escalated pretty quickly. We could...