Jan 27, 2021, 12:00 AM
“Telling a programmer there’s already a library to do X is like telling a songwriter there’s already a song about love.” - Pete Cordell
Sometimes, it feels like questions that arise during my time programming take years to answer. In...
Moving my life to Dokku
Jan 7, 2021, 12:00 AM
While it’s a bit passé to not blog for over a year, and then dive right back in by talking about your blog setup, I’m going to do it anyway. I recently moved all of my static sites and Swift services over to Dokku, and I am really enjoying...
Regexes vs Combinatorial Parsing
Dec 3, 2019, 12:00 AM
Recently, I’ve been working on a music app that needs to get a musical sequence (like a melody) from the server to the client. To do this, we use a format called ABC. (You can read about how ABC music notation works here.) We chose ABC...
Aug 16, 2019, 12:00 AM
A few years ago, I wrote Implementing Dictionary In Swift, which was a crash course on how to create something similar to Swift’s Dictionary type.
Since our dictionary will be backed with an array, we need a way to convert the key...
Jul 16, 2019, 12:00 AM
A few months ago, Aaron Patterson tweeted about some three-year-old uncommitted code:
tfw you work on a patch for 3 years and it’s like 2k lines and then you commit it and hope CI passes
Aaron’s CI build, naturally, didn’t pass.
Mar 19, 2019, 12:00 AM
Just a heads up — this blog post has nothing to do with the coordinator pattern.
Those that have been following my blog for a long time might remember an old post, Cache Me If You Can. The idea behind the post was simple: if you just want...
Dec 17, 2018, 12:00 AM
In Dave Abraham’s WWDC talk, Embracing Algorithms, he talks about finding common algorithms and extracting them into the generic (and testable) functions. One thing in this vein that I like to look for is a few collection operations that...
Streaming Multipart Requests
Nov 14, 2018, 12:00 AM
Foundation’s URL loading is robust. iOS 7 brought the new URLSession architecture, making it even more robust. However, one thing that it’s never been able to do natively is multipart file uploads.
What is a multipart request?
Bloom Filters and Swift 4.2
Sep 19, 2018, 12:00 AM
Swift 4.2 brings some new changes to how hashing works in Swift. Previously, hashing was fully delegated to the object itself. You would ask an object for its hashValue, and it would respond with the fully cooked integer representing the...
Hacking Hit Tests
Sep 7, 2018, 12:00 AM
This article is also available in Chinese.
Back in the days before Crusty taught us “protocol-oriented programming”, sharing of implementations happened mostly via inheritance. In an average day of UIKit programming, you might subclass...
Aug 22, 2018, 12:00 AM
Martin Fowler’s seminal 1999 book Refactoring includes a chapter with Kent Beck on “code smells”. Code smells, they say, are “certain structures in the code that suggest (sometimes they scream for) the possibility of refactoring”. One of...
Missing The Else
Aug 15, 2018, 12:00 AM
A lot of what I do for my clients is code review. Code review is one of the better ways we know of to catch bugs early. I’ve been doing more code review in my day-to-day, and I’ve started to notice patterns arising out of the mire — little...