Adapting Traits for Kotlin

A Macbook pro with code on the screen, a small notepad and blue ink gel pen.

Traits are a pattern introduced in Scala (at least, this was my first introduction to them) that help avoid deep class hierarchies in favor of composition. If you don’t have Scala experience, but do have Java experience, you can treat this similarly to Java 8 Interfaces. However, I still prefer to call them Traits. Although […]

Comparing Kotlin to Scala

Kotlin to Scala. Scala to Kotlin. Two contenders for my heart. In the left corner, we have the new comer! Weighing in at just over 1.2MB — The Ambassador of Android: Kotlin! And in the right corner, we have the long-time favorite, weighing in at just over 5.3MB — The Archduke of Akka, The Sultan […]

Formatter Objects: Testable Fragments

An orange origami boat

Let’s face it — Fragments are a pain to test and it’s predominantly due to how the Android operating system works. Sometimes, you’ll find yourself writing business rules regarding how a view is displayed. Likely, some data will come back from a web server and you’ll have to format some text differently or color something […]

Controllers in Ktor

Ktor is a microframework written in Kotlin. It’s focus is on building asynchronous servers and clients in connected systems. I’ve been using it predominantly for the “server” slice of that statement. I call Ktor a “microframework” simply because, while it’s opinionated, you have a lot of freedom in the way that you accomplish tasks within […]

Lambda-Map Performance in Kotlin

Kotlin Bytecode

Working on an enterprise application written in Kotlin, I’ve recently noticed something that felt “off” to me. Perhaps you’ve seen it, perhaps you’ve written it — maybe even recently!  It looks something like this (I call this a Lambda-Map): Sure, this plusOne function isn’t really necessary. We can just inline it in the Lambda, but imagine […]

Introducing KotlinToday.com

When I was learning Clojure for the first time, I had two references that I found myself reading every single day. The first resource is a fantastic guide by Daniel Higginbotham called Clojure for the Brave and True. The second resource that I found myself using allowed me to immerse myself into the Clojure community and […]