jzbrooks

  • Autocomplete and the Hollywood Principle

    You don’t have to bear autocomplete bugging you all the time. There’s a better way.

  • Value Class Equality

    Value classes show a lot of promise for bringing value semantics to Kotlin classes. The feature is still young, but it isn’t hidden behind a compiler option anymore, so I’ll consider it fair game.

  • Enum Comparison vs is Operator

    Kotlin sealed classes are pretty great for modeling a fixed set of choices that may have associated data1. However, newfangled technology tends to cost something 2. Compilers, virtual machines, and operating systems can often compensate over time for the incurred performance cost.

  • React, Compose, & SwiftUI

    The Android UI framework has been around since Android’s birth and available publically since 20091. While there have been some notable changes, like the advent of fragments in the honeycomb release, the fundamental substrate has been largely the same. These days View.java is a good text editor performance benchmark, lists in the UI require carefully arranging several components, and buttons can be configured to make their text label selectable. It’s time to begin again.

  • Dispatchers.Main & Android

    Coroutines provide a “lightweight thread” abstraction that—among other things—makes getting off of the main thread dead simple. How, though, do coroutines avoid slowing down the main thread if you never leave it?

  • Optimizing Vector Artwork

    Vector artwork is pretty useful. It can scale nearly infinitely without graphical artifacting, interesting animations are straightforward, and it can frequently be smaller than the same image represented as a grid of pixels (often referred to as raster images). Many UI systems support some form of vector artwork. SVG, vector drawables, and vector PDFs are just a few.

  • Kotlin Suspend Bytecode

    The suspend keyword plays an important role in kotlin coroutines and was the only language-level change to support the feature. The team at Jetbrains decided to implement coroutines as a library rather than a language level feature. This means that anyone could write their own implementation of coroutines.

  • JVM Startup Is Slow

    It’s been a while since I’ve worked on a program that relies on the Java Virtual Machine. I learned Java in college and have been using it since in some capacity or another. These days programming at my day job typically involves writing Kotlin for Android.

  • Dalvik Bytecode

    In the spirit of understanding the machine you’re programming, it’s important to understand how Android’s machinery differs from the Java Virtual Machine. Understanding the Android compiler toolchain and ART require it.

  • Bytecode for Android Developers, A Gentle Introduction

    Computers are complicated systems built on decades of abstraction. As software craftsmen, it is a worthwhile endeavor to understand these abstractions. Pursuing an understanding of the details of systems being programmed helps us more deeply appreciate our craft—propelling it forward.