This week I hacked on a macOS GUI application. It’s built in Zig and Swift and uses SwiftUI, Apple’s relatively new UI framework.
I’ve written around 100 lines of Zig code in my life, 0 lines of Swift, and have only once built a proper GUI app — in 2001, using GTK and GNOME to display “Hello, World!”
Swift and SwiftUI also kinda require you to use Apple’s IDE, Xcode, something that I’ve also only used in the peeked-inside-and-said-”ah, ok” sense. You can get by without it, I’m sure, but I’ve worked with iOS engineers in the past and having seen how much build logic can be contained in a Xcode project definition I decided to use it.
New language, new platform, new framework, new IDE.
It was quite something.
I copy & pasted code, I cursed, I googled errors, I asked ChatGPT, I asked Cody, I prayed to Xcode’s autocomplete.
I did binary-search-commenting-out of code where I just commented out the first half, reran the build, noticed it still doesn’t work, commented out the other half, reran the build, noticed that it still doesn’t work, said “I need a break”, and got up.
Nothing here is new. Many times have I hacked together code by blindly copy & pasting. I’ve googled error messages ever since people said that it’s a secret trick. My heart knows the desparate hope to find something else besides the unanswered StackOverflow question from 7 years ago more than it knows the joy of an eureka moment. Commenting out code as a last resort? Yeah, I’ve been there - many times.
What’s new is the sum of it. I don’t think I’ve ever been in a programming situation where I didn’t have any mental model of what was going on. I always knew something: either the language or the tooling, or the platform, or the framework and its way of thinking.
I’ve hacked apart the JavaScript of someone else’s website without knowing anything but the string to search for in the *.js file — but I know the web. I rappelled into unknown codebases before to leave 1-line fixes, screaming “get me out of here” right after — but I knew the language and the tooling and the runtime.
Here I was completely blind and I started to wonder: is that common? Is that what it’s like for people fresh out of college that go into a new job, using a language and framework they’ve never heard of, expecting training-on-the-job?
Is that why people use IDEs? To do what I did and type `window.f`, hoping, yearning for that autocomplete box to show up with the `focus()` method I’ve been looking for?
It was very strange. Very frustrating. Very refreshing, in the cold shower kind of sense.
Illuminating, too. I realised: I like learning by doing, but I need to know something, anything, before I start. How different would this week’s experience have been, had I spent 1 hour reading about SwiftUI or looking at an Xcode cheat sheet?
(Note: talking about stumbling in the dark — I’d love to hear from you! What you think about the newsletter, what you enjoy or don’t enjoy about it, which advice you have for me.)
I quite like reading your perspective and the way you describe your thoughts, it's kinda what I'm trying to do on my own newsletter "Bit Maybe Wise" (though it's paused for the past month due to vacation). Keep it up!
I always look forward having a coffee and reading your post on a Sunday morning so as far as I am concerned keep doing this Thorsten :)