Autocomplete and the Hollywood Principle
You don’t have to bear autocomplete bugging you all the time. There’s a better way.
Building Consensus Through Writing
Over the past couple years I’ve been fortunate to have been in a leadership position at my day job. Before I took on the role I believed that the best part of leadership must be authority to make unilateral decisions. It turns out that organizational leadership isn’t often best served by unilateral decision making. More often than not, consensus building is the name of the game.
The Dismal State of Technical Writing
A few days ago I was chatting with one of the more senior engineers in my company the about finding good technical books when he suggested that good engineering books are harder to come by than they sused to be. The idea seemed consistent with my generally cynical perspective on the state of the software engineering craft, so I flipped through a few technical books to jog my memory and was surprised to generally find the cynicism to hold.1
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.
How ART Implements is
When I was a few months into my first job after college, I was told that there’s such a thing as fast and slow reflection. Type checks via the C# is operator was apparently fast, which reflecting through method definitions wasn’t. Years later
InitializeTypeCheckBitstrings
https://cs.android.com/android/platform/superproject/+/android-11.0.0_r3:art/dex2oat/driver/compiler_driver.cc;l=753-794;drc=android-11.0.0_r3
DoLookupResolvedType
https://cs.android.com/android/platform/superproject/+/android-11.0.0_r3:art/runtime/class_linker.cc;l=8616-8642
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.