The Computer History Museum, with the permission of Apple, has made available the original program source code of MacPaint and the underlying QuickDraw graphics library.
MacPaint is the drawing program application which interacts with the user, interprets mouse and keyboard requests, and decides what is to be drawn where. The high-level logic is written in Apple Pascal, packaged in a single file with 5,822 lines. There are an additional 3,583 lines of code in assembler language for the underlying Motorola 68000 microprocessor, which implement routines needing high performance and some interfaces to the operating system.
[…]
In writing MacPaint, Bill was as concerned with whether human readers would understand the code as he was with what the computer would do with it. He later said about software in general, “It’s an art form, like any other art form… I would spend time rewriting whole sections of code to make them more cleanly organized, more clear. I’m a firm believer that the best way to prevent bugs is to make it so that you can read through the code and understand exactly what it’s doing… And maybe that was a little bit counter to what I ran into when I first came to Apple… If you want to get it smooth, you’ve got to rewrite it from scratch at least five times.”¹
MacPaint was finished in October 1983. It coexisted in only 128K of memory with QuickDraw and portions of the operating system, and ran on an 8 Mhz processor that didn’t have floating-point operations. Even with those meager resources, MacPaint provided a level of performance and function that established a new standard for personal computers.
Summer reading for everyone’s inner geek.