Open Source & Zelda

People do open source for lots of reasons. One reason that I do open source is because I enjoy it... Recently I had fun connecting Okio to zlib. It even had fun side quests: I learned about zlib, info-zip, PKZip, and how they relate. Sometimes a project’s logo tells…

Decisions, Deciders, and Executors

Most of the software I write exists to automate a process. It might automate a high-level workflow like peer-to-peer money transfers, or a low-level implementation detail like encoding an HTTP request as bytes. I’ve learned that my code is healthier when it’s strictly divided into value objects, service…

A non-scientific survey of ZIP Metadata

Okio's has an openZip() function that views a .zip file as a FileSystem. To expose file metadata in the file system API, Okio must extract it from the .zip file. There’s at least four ways to encode timestamps in a .zip file. I wanted to find out which of…

Honor and Internal Visibility

I don’t do many crimes. I don’t even do crimes that I could do without getting caught! Every single time my dog poops on the sidewalk, I pick it up. Even if nobody’s watching! I have honor. With that disclaimer out of the way, here’s instructions…

WebAssembly is like JSON for behaviour

If you’re sending data from one computer to another, it’s probably JSON. But it hasn’t always been this way. How we Transmitted Data Before JSONBefore JSON got popular (2005ish) we had XML, CORBA, Java serialization, Python Pickle, and a bunch of other clever and complex encoding schemes.…

Preparing for Network Failures this Holiday Season

Suppose I’m connecting my home Christmas lights to the Internet. Perhaps I’ll make a mobile app that calls my home control server via an HTTP API: POST /lights/toggle HTTP/1.1 { "subjects": ["maple_tree", "roof"] }HTTP/1.1 200 OK { "toggled": true }It works. I can finally…

Your Company’s DanceService probably doesn’t Dance

I work on a big product at a big company and we have lots of backend services that have big responsibilities: The messaging service sends customers their emails, SMS messages, and push notifications.The banking service manages the customers’ bank accounts.The identity verification service verifies customers’ identities.Except that…

Farm or Grind

Suppose your organization has a widely-used internal library for validating customer usernames: private val usernameRegex = Regex("[a-z]{2,40}") fun isValidUsername(username: String): Boolean { return usernameRegex.matches(username) }The function becomes widely adopted: Some callers use it during customer sign-up. We don’t want customers putting slashes in their usernames!…