Assumed Audience:practitioners or interested lookers-on for software development — and Apple itself.
Edit:some folksrightly pointed outthat my use of “garbage” suggests that the problem is the quality of the existing documentation; I’ve retitled the post to capture that the problem is themassive absenceof documentation. You can see the original title by way of the slug.
Over the past few months, I have been trying to get up to speed on the Apple developer ecosystem, as part of working on myrewriteproject. This means I have beenlearningSwift (again), SwiftUI, and (barely) the iOS and macOSAPIs.
It has beenterrible. The number of parts of this ecosystem which are entirely undocumented is frankly shocking to me.
I was wrong. The current state of Apple’s software documentation is the worst I’ve ever seen for any framework anywhere.
Swift itself is relatively well covered (courtesy of the well-written and well-maintained book). But that’s where the good news ends.1Most of SwiftUI is entirely undocumented — not even a single line explanation of what a given type or modifier does. Swift Package Manager hasokaydocs, but finding out the limits of what it can or can’t do from the official docs is difficult to impossible; I got my ground truth from Stack Overflow questions. I’ve repeatedly been reduced to searching throughWWDCvideo transcripts to figure out where someone says something relevant to whatever I’m working on.(2)
This is, frankly, unacceptable. In the Ember ecosystem, we have a simple rule that code doesn’t get to ship unless it’s documented. The same goes in Rust (I should know: IwrotetheRFCthat made that official policy). Now, I understand that Apple’sAPIdevelopers (often) work in a different context than these open source projects — especially in that they face crunches around releases which are tied to hardware products shipping.
But. At the end of the day, when you’re vending anAPI, it isn’t done until it’s documented. Full stop.
Given what I know of Apple’s approach to this, the problem is not individual engineers — who are not responsible for writing docs; that is the responsibility of dedicated coumentation teams. But that does not make it any less a failure of Apple’s engineeringorganization. The job of anAPIengineering organization is to support those who will consume thatAPI. I don’t doubt that many of ApplesAPIengineers wouldlovefor all of these things to be documented. I likewise do not doubt that the documentation team is understaffed for the work they have to do. (If I’m wrong, if Ishoulddoubt that, because Apple’s engineering culturedoesn’tvalue this, then that’s even worse an indictment of the engineering culture.) This kind of thing has to change at the level of the entire engineering organization.
Apple, if you want developers to love your platform — and you should, because good developers are your lifeblood — and if you don’t want them to flee for other platforms — and you should be worried about that, because the web is everywhere and Microsoft is coming for you — then you need to take this seriously. Adopt the mentality that has served other frameworks and languages so well:If it isn’t documented, it isn’t done.