mark cerqueira well-rounded nerd

Excellent Tooling is a Great Teacher

I’m a big believer in programming languages living in an ecosystem and not in a vacuum chamber.

Today’s thought takes me back to my on-site interview at Evernote. Given I had both iOS and Android experience (but had done Android more recently) I interviewed with some Android engineers and one iOS engineer. During the interview I was asked if my Objective-C code would look Java-esque; in short, was I still capable of writing idiomatic Objective-C code.

Writing Kotlin today that interview question comes up again and again in my mind. I still feel like I’m writing Java but in Kotlin and learning how to make it more idiomatic as I go along. Learning comes from a bunch of places like coworkers, Kotlin documentation, and example code but another great teacher has been Android Studio.

Here’s some Kotlin code I wrote recently. It’s not the best way to accomplish what I’m doing in Kotlin. Android Studio inspections to the rescue! Within a second of writing this code I got some green squiggle marks under the for. Command-enter and then selecting Replace with count{} gave me this:

Yes I could pore through documentation and blog posts about writing idiomatic Kotlin but there’s nothing more frictionless than having your development tool give you a hand when it sees you’re writing Kotlin in a Java-esque way. Thanks Android Studio for teaching me about count!