Refactoring to Kotlin

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

more

Failure is not an Option - Functional Error Handling in Kotlin. Part 7 - Avoiding Failure

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...

more

Failure is not an Option - Functional Error Handling in Kotlin. Part 6 - What Should You Do While Waiting for the Standard Result Type

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...

more

Kotlin Hacks - .printed()

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...

more

Press to Test - Test Driven Development in Android Part 7

This is the final part in a series documenting my experiences learning Android development in Kotlin. The code is available to follow along on GitHub.

In Part 1 I got a simple UI toy up and running, with tests running via Espresso in an emulator.

In Part 2 I used Roboletric to get (a lightly refactored version of) the same tests running in a local JVM rather than the emulator.

Part 3 was spent...

more