For decades, the phrase "You are not expected to understand this" has been the ultimate flex in hacker culture, printed on everything from baby onesies to conference sweatshirts. But at the recent Systems We Love conference in San Francisco, systems researcher Arun Thomas finally pulled back the curtain on what Dennis Ritchie actually meant in the Sixth Edition Unix source code. The comment, buried within the context switching logic of 1975, wasn’t an insult to developer intelligence—it was a pragmatic acknowledgment that the mechanism for multi-tasking was genuinely complex, even for its creators.
The Reality Behind the Myth
Thomas explained that the comment appeared in the swtch() routine, which handles the critical task of saving and restoring process contexts. While Ritchie later clarified on his website that the remark was intended in the spirit of "This won’t be on the exam," the code itself contained a significant bug. The Unix authors, despite their genius, didn’t completely understand their own implementation at the time. Thomas emphasized that context switching is a "neat trick" that enabled Unix’s massive adoption by allowing time-sharing, but the hardware interactions involving stack pointers and registers are notoriously difficult to get right. The popularity of this obscure line of code owes much to John Lions’ book, Comments on Unix v6, published in 1977. When AT&T tightened licensing in 1979, Lions’ book became the primary way for students and engineers to study Unix internals. It was, according to Wikipedia, "the most copied book in computer science," with people photocopying photocopies to share the source code. Thomas noted that the book’s popularity inadvertently turned Ritchie’s throwaway comment into a cultural artifact, with one attendee even bringing his unauthorized physical copy of the text to the talk.
Modern Relevance of Legacy Code
Despite the 1975 origins, the fundamental architecture remains intact. Thomas pointed out that modern operating systems like FreeBSD still rely on the same process abstraction, though the implementation has evolved. The original swtch() function has been split into cpu_switch() for hardware-specific tasks and sched_switch() for machine-independent scheduling. While today’s kernels handle threads and dynamic linking—complexities unknown to the PDP-11 era—the core mechanism of saving state, selecting the next highest-priority process, and restoring context is unchanged. The comment disappeared from the mainline code in Unix v7, but its legacy persists in the way we discuss low-level system reliability.
Key Takeaways
- Dennis Ritchie’s 1975 comment was a humorous caveat about the complexity of context switching, not a dismissal of the reader's ability.
- The original Unix v6 context switching code contained bugs, proving that even legendary engineers struggle with low-level concurrency.
- John Lions’ book was instrumental in spreading Unix knowledge and cementing the fame of the infamous comment during the licensing restrictions of the late 70s.
- Modern Unix-like systems, including FreeBSD, still use the same fundamental process abstraction and context-switching logic established in 1975.
The Bottom Line
If you’re writing infrastructure code today, remember that even the creators of Unix didn’t fully understand their own kernel. Complexity is inevitable, but clarity is a choice—don’t let your comments become riddles.