The first time I saw an if sitting on the right side of an =, I assumed it was a typo. It isn t: since Swift 5.9 an if or switch can produce a value directly instead of just branching to a block of code. These are called conditional expressions, something Kotlin, Rust, Scala, and Ruby Continue reading Conditional Expressions in Swift
Not long ago I was digging through the string API of a programming language and fell down a rabbit hole into Unicode. I ran little experiments, took a pile of notes, and came away understanding far more than I set out to. This article is my attempt to capture those learnings — the details of Continue reading Unicode, Bit by Bit
Over the years I ve spent a lot of time poking at Swift s numeric types — writing little experiments, hitting unexpected results, and going down rabbit holes. Here are ten things that surprised me. 1. Print Lies (A Little) Before diving in, there s something important to know: print doesn’t show the full precision of the stored Continue reading Fun with Swift Numbers
Codebases accumulate patterns over time that don t match up with current best practices. These patterns might have made sense when they were written, or they might just reflect how our understanding has evolved. Before you can address these patterns, you need to spot them and understand why they re risky. One particularly dangerous combination in iOS Continue reading The Dangers of Mixing Locks…
When I was a teenager, I got really into philosophy. I’d sit at my desk with blank paper (this was before smartphones), scribbling down every half-baked thought about existence and consciousness. Whatever rabbit hole I’d fallen into that week. I realized that brainstorming on paper forced me to actually think. All those “profound” ideas bouncing Continue reading How I Use Voice and AI to Turn…
I’ve been thinking about a process I’ve used for resolving regressions that may be useful to share. I’ve never explicitly written the steps down before, but figured it was worth capturing—both for myself and others. When a regression shows up, there are three questions that I’ve found you have to answer. Skipping any of them Continue reading A Simple Checklist for Debugging Regressions
While there are plenty of smart devices to control central heat and air conditioning, these will not usually work with portable units. Using a Raspberry Pi with a few simple electronics, I was able to upgrade the control of my window A/C unit. At a minimum, I wanted to turn the A/C on and off Continue reading Take Control of Your Window AC Unit
If you’ve been watching the server-side Swift changes this year, you may have noticed the building momentum. The Vapor community reinforced their commitment to server-side Swift by pushing significant updates in Vapor version 4. That was followed by a new server-side Swift platform the Swift AWS Lambda Runtime, complete with a WWDC video. Apple Continue reading Why You Should Learn Server-Side…