folklore.org
The Original Macintosh:    106 of 127 
Switcher
Author: Andy Hertzfeld
Date: October 1984
Characters: Andy Hertzfeld, Neil Konzen, Bill Gates, Bud Tribble, Steve Jobs, Steve Capps, Charles Simonyi, Phil Goldman, Tom Petrie, Victor Bull, John Markoff, Burrell Smith, Guy Kawasaki
Topics: Software Design, Technical, Compensation
Summary: The Macintosh's first multi-tasking environment
The Switcher About Box

The first commercial product that I worked on after going on leave of absence from Apple in March 1984 (see Leave Of Absence) was a low cost, high resolution scanner for the Macintosh called Thunderscan, that I created in collaboration with a tiny company named Thunderware (see Thunderscan). I started working on it in June 1984, and by early October, it was almost complete.



Tom Petrie, one of the two principals at Thunderware (the other was Victor Bull, who I worked with on the Silentype thermal printer (see What Hath Woz Wrought), the first project that I did for Apple), arranged a few demos for various computer magazines, to curry favorable reviews to promote the product. On October 11th, 1984, I drove with Tom to an office in Hillsborough, to demonstrate Thunderscan for Byte magazine.

The Byte reviewer was John Markoff, a technology scribe for the San Francisco Chronicle who was one of the best reporters covering the personal computer industry. Tom described Thunderscan while I set up the demo and started scanning. John asked a few questions, taking notes with his IBM PC, which was running a character-based text editor that I viewed with the typical pious disdain of a Macintosh purist. As I was answering one of his questions, the phone rang.

"Excuse me," he told us, as he pressed a key combination on his keyboard, his monitor screen instantly changing to a different program. He talked on the phone for a minute or two, occasionally typing, before he finished the conversation and pressed a key combination to switch back to his Thunderscan notes.

"What did you just do?," I asked John, curious about the software that he was running. "How did you switch to another application so quickly?"

"Oh, I'm running Memory Shift. Haven't you seen it?" John responded. "It's a DOS utility program that keeps multiple applications resident in memory, and allows you to switch between them quickly. I've been using it a lot lately." John typed the switch command a few times in rapid succession, to show me how fast it could do its thing.

"You know, I think I could do that for the Macintosh", I suddenly blurted out, before I even thought about it consciously.

The 512K Macintosh, with four times the memory of the original, had just started shipping a few weeks ago. I had considered trying to run multiple applications simultaneously on the 512K Mac, but I was stymied by low memory conflicts and other potential gotchas. But now, as I observed Memory Shift in action on John's PC, I suddenly saw a simple way to do it, which didn't seem to be too hard to implement.

"Yeah, that would be cool," John agreed. I continued with the Thunderscan demo, but it was hard for me to concentrate on it, because I couldn't stop thinking about application switching. There were a few intricate problems to solve, but it seemed eminently doable, and I thought it would be incredibly useful if I got it to work.

Tom Petrie noticed how excited I was about the new idea and, as he drove me home from the demo, he reminded me of my prior commitments, and made me promise that I would finish the alpha release of Thunderscan as soon as possible, before daring to start something new. We agreed on a list of a dozen or so tasks, which I thought I could accomplish within two weeks. Once the alpha release was completed, I could take a short hiatus, in order to work on application switching, before diving back into Thunderscan to finish the 1.0 release, due by the end of November.

During the next two weeks, I focused on polishing Thunderscan to get it ready for the alpha release, but I also spent idle moments pondering the design of the application switcher. One fundamental decision was whether or not to load all of the applications into a single heap, which would make optimal use of memory by minimizing fragmentation, or to allocate separate "heap zones" for each application. I decided to opt for separate heap zones to better isolate the applications, but I wasn't sure that was right.

There were lots of little problems to solve. The most crucial one was that the system software kept lots of application-specific global variables in low memory (see Mea Culpa), which needed to be swapped during context switching, so each application could maintain its own set of them. The hard part was coming up with the precise list of exactly what needed to be swapped; many of the variables were obvious, but some were quite subtle, and dependent on how applications were using them. I knew that my first cut wouldn't be perfect, but I was confident that I could debug the inevitable problems once I saw how the applications were actually failing.

A few days after starting the push to finish Thunderscan, I received an intriguing phone call from Jeff Harbers, the manager of Microsoft's Macintosh applications team. Jeff told me that Microsoft had a very strategic project that they needed for the Macintosh, and that they thought that I was the ideal person to implement it. He wouldn't tell me anything else over the phone, but he offered to fly me up to Seattle to discuss it in person. Even though I was right in the middle of trying to complete Thunderscan, I was intrigued enough to accept his offer to fly up to Seattle and visit with him the following Tuesday.

Jeff picked me up at the airport, and we drove to Microsoft's main building where we were joined by Neil Konzen, a talented 23 year old who was Microsoft's main systems programmer on the Macintosh. I knew Neil from his days as an early Apple II hobbyist, when we collaborated on adding features to an assembly language development system when he was only 16.

Jeff asked me what I was working on, and I told him about Thunderscan, which he seemed to be interested in. But when I mentioned that I was about to start some experiments with an application switching utility, his jaw dropped, and he looked like he couldn't believe what I said.

"That's just what we wanted to talk with you about!", he exclaimed, "It's great that you're already working on it".

Jeff explained that Microsoft had put a lot of effort into getting their applications to run well in the tiny space available in the 128K Macintosh, which they considered to be a key competitive advantage. But as things stood, the 512K Mac would undermine their efforts, since it allowed applications to be much larger. Plus, Lotus had recently announced an integrated application suite for the 512K Macintosh called Jazz that made it easy to quickly switch between different functional areas. But if the Macintosh could run multiple applications simultaneously, the small memory footprint of the Microsoft apps would continue to be advantageous, since their lower memory requirements meant that more of them could run concurrently, and users could put together customized application suites on their own. The purpose of the visit was to convince me to write an applications switcher under contract to Microsoft.

Neil Konzen had contemplated a potential design, which he conveyed to me in front of a whiteboard. He decided to use the single heap approach that I had rejected, along with a few interesting twists to minimize memory fragmentation. I told him about the alternate approach of using separate heapzones, and how I thought that it was probably worth it to trade some memory fragmentation for greater robustness. I told him that I would give his approach some more thought.

Finally, my afternoon at Microsoft culminated in a private meeting with their CEO, Bill Gates. Jeff ushered me into Bill's office and reviewed the afternoon's discussions for him, before excusing himself to leave us alone to negotiate a development deal. I had met Bill a few times during the course of Macintosh development, and while I respected his technical acumen, I was wary of his burgeoning reputation as a conniving businessman.

After exchanging a few pleasantries, and telling me how much the Macintosh mattered to Microsoft, he looked me in the eye and said, "You're a really good programmer, right? I think you must be a really good programmer."

"I guess so," I responded, not understanding why he was attempting to flatter me.

"Well, I think you are. How long do you think it will take to do this project? A month or two? I think a really good programmer like you could get it done in less than two months."

"I really have no idea," I replied, "I'm not far enough along to know if it's even feasible yet."

"Well, let's figure it out," he said in a slightly condescending tone. "I don't think it could be more than 10,000 lines of code, and a really good programmer like you should be able to write at least a thousand lines of code per week, so I think it will take you less than 10 weeks to write it, if you're as good as I think you are."

I didn't know how to respond, so I kept quiet and let him continue.

"And how much do you think a really good programmer should get paid? Around here we pay our best programmers around two thousand dollars per week. Do you think you should be paid more than that?"

"I don't know," I replied. I was finally beginning to see where he was coming from. Bill was trying to get me to brag that I could write the application switcher really quickly, so he could justify paying me a lower price for it.

"Well, I don't think that you could expect to get more than four thousand dollars per week, tops. Actually, I think that's too much, but let's go with that. If it takes ten weeks, and you get paid four thousand dollars per week, that means you should get paid $40,000 for writing it."

$40,000 didn't sound like very much to me, especially if it was as strategic to Microsoft as it seemed to be. I think Bill was expecting me to make a counteroffer, but I wasn't very enthusiastic about selling it to Microsoft regardless of compensation, since it really should eventually be part of the Mac OS.

"Listen, I really want to write this, completely independently from you guys, so you won't have to pay me anything to do it. I certainly don't want to negotiate a deal until I see how it turns out; there might be a show-stopper and I won't be able to get it to work at all. And if I pull it off, it really should be bundled with every 512K Macintosh."

Bill shifted his tactics. "OK, I don't really care if Microsoft owns it as long as it's available to our users. I want you to commit that you'll apply your best efforts to making sure that it runs well with our applications, and that you'll call Jeff if you run into any snags. We can talk again about publishing it later if you want to after you're further along. How does that sound?"

I told him that sounded good, and I promised to do my best to make it work great with Microsoft's applications, which I wanted to do anyway, since the Microsoft apps were important to most users. We shook hands and I departed on a positive note.

By the time I returned to my house in Palo Alto that evening, I was burning with the desire to see if I could get something going quickly. Even though still I had a few more days of work to complete the Thunderscan alpha release, I decided to see if I could write a proof of concept prototype of the application switcher first.

I would eventually have to write a user interface for selecting applications, but the proof of concept didn't have to worry about that; it was hardwired to run MacPaint, MacWrite, MacDraw and the Finder. I worked for 20 hours straight writing the core of the program, which worked by patching traps to extend a few essential system calls, like GetNextEvent, Launch and ExitToShell. The hardest part was going through all of the low memory locations, determining what needed to be swapped. It was incredibly satisfying to see it begin to work, crashing all the time at first, but gradually stabilizing as I tracked down various problems.

I had it working for an hour or so when I saw Bud Tribble return home. Bud had finally finished his M.D./Ph.D. program at the University of Washington, including interning for a year, but he decided that working on the Macintosh was more fun than being a doctor, so he had returned to Apple in his old job as software manager a few months earlier, in July 1984. Bud was living at Burrell Smith's house, which was next door to mine.

I dragged Bud over to my house to show him how I could rapidly switch between MacPaint, MacWrite and MacDraw. He was impressed, but to my surprise he complained that the switching, which was almost instantaneous, was actually too fast.

"I think it might be confusing to switch from one application to another without any feedback," he told me. "What if someone switches accidentally? Maybe you could use animation to make a smoother transition."

That sounded like a great idea to me. We decided that one application should scroll off the screen horizontally while another was scrolling on, which gave the users a simple, concrete mental model of the applications wrapped around a sort of Lazy Susan, which they could rotate to move the desired application to the visible area. I quickly wrote some fast scrolling routines, and was blown away by how cool it looked to see the applications zip across the screen.

I started showing my proof of concept demo to my friends at Apple, as well as a few user group demos, and it was very positively received. Unfortunately, I still had to finish up the product release of Thunderscan, which I barely managed to do by the end of November as I had promised. After taking a short vacation, I got back to work on what I was now calling "Switcher" in early December and by Christmas I had much of it implemented, including a simple UI for selecting applications and "Switcher Documents" for remembering sets of related applications.

In early January 1985, I got a phone call from Guy Kawasaki, one of Apple's third party evangelists, who told me that Apple was interested in buying Switcher, and that he was assigned to make that happen. The first step was arranging a demo for Steve Jobs.

I entered Steve's office with a bit of trepidation, because I thought that Switcher was worth at least a quarter of a million dollars to Apple, but I was sure that Steve would never want to pay me that much. But I was also proud of Switcher, and was interested in seeing how Steve would react to it.

I booted up my by now standard demo of MacWrite, MacPaint, MacDraw and the Finder, as well as a little maze generating program written by Steve Capps. I configured Switcher with the scrolling animation initially turned off, so it would have more impact when I showed it later. I demoed cutting and pasting between MacWrite, MacPaint and MacDraw, in seconds instead of minutes, and then I turned on the scrolling animation, and starting switching rapidly between them, in both directions.

"OK, I've seen enough, " Steve interrupted me. "It's great. Apple is going to bundle it with the Mac. Congratulations."

But then he paused, and stared at me for a moment with an incredibly intense gaze, as if he was sizing me up or maybe just trying to scare me.

"But I don't want you taking advantage of this situation. I'm not going to allow you to take advantage of Apple."

"What do you mean?" I asked him, genuinely puzzled.

"There's no way that you could have written that program without confidential information that you learned by working at Apple. You don't have the right to charge whatever you like for it."

I started to get angry. "The program is only half finished, and if I don't think you're paying me fairly, I won't be motivated to finish it."

Steve gave me another intense stare as he paused for a few seconds. Then he stated a single number, without explanation.

"One hundred thousand dollars."

"I don't know," I told him, "I think it's probably worth a lot more than that."

"Don't argue with me. $100,000 is fair, and you know it."

I didn't seem to have any alternative but to capitulate to Steve's price setting, since he's difficult to argue with and I really wanted Switcher bundled with the Mac. I eventually negotiated the final agreement with Guy Kawasaki, where, in addition to the $100,000, I managed to get a 10% royalty of the wholesale price if Apple sold Switcher separately, which Steve swore they would never do, but eventually the royalty delivered another $50,000.

Getting Switcher going wasn't that hard, but it was a very difficult program to finish, because it overturned some of the underlying assumptions that applications were making, yet it was committed to keeping everything working anyway. Much of the work in the latter stages involved testing it with every application that I could get my hands on and debugging crashes. Usually I could concoct some kind of technique that would mitigate the problem without causing worse problems elsewhere.

Predictably, the hardest part of finishing Switcher was making it work smoothly with the Microsoft applications. That was partially because Microsoft was a very early developer, and took liberties with the system that most developers would shy away from, but it was mostly because the instructions comprising their applications were encoded in pseudo-code to save space, in the tradition of the byte-code interpreters from Xerox, which Charles Simonyi advocated.

Unfortunately, the pseudo-code kept me from disassembling the program when it crashed, which made it more difficult to debug. I finally developed a debugging technique by single stepping through their interpreter, six instructions at a time to get to the instructions that were doing the work, but it was pretty painful. I was determined to slog through it because of the promise that I made when I visited Microsoft.

One of the last problems that I addressed before finishing the first release of Switcher in March 1985 had to do with applications hanging. If you're running multiple applications, you don't want one application hanging to take down all of them. I added a feature that allowed the user to kill the current application if it was hung up, by monitoring for a specific key combination during the vertical blanking interrupt handler.

I knew that I had to pick a very rare key combination, because you didn't want users killing their applications accidentally. I decided on shift-command-option-period, four keys held down at once, which I thought would be pretty hard to stumble into accidentally. But I was surprised when I got a call from Jeff Harbers at Microsoft.

"Hey, I like that abort feature that you just added, but you're going to have to change the key combination, because we're using that in Microsoft Word.", Jeff told me. Microsoft Word was very complex, and it possessed an enormous range of keyboard shortcuts, way too many, as far as I was concerned.

"OK, suggest something for me to change it to and I'll consider it," I told Jeff.

Jeff didn't have anything specific in mind, so he told me that he would get back to me soon. I had to laugh when he called me back the next day, and told me that he wanted to withdraw his request and that I should keep shift-command-option-period as the abort sequence.

"OK, that sounds good to me, " I told him. "But why the change? Doesn't it still conflict with Word?"

"We'll change Word in the next release not to use it. The problem was that we couldn't find a safe sequence - I guess we're already using every key combination!"

I officially released the finished version of Switcher in April 1985, and I maintained it for a few versions after that. Eventually, I handed it off to Phil Goldman, a tremendous young programmer from Princeton who was recently hired at Apple, who went on to write MultiFinder (with Erich Ringewald), Switcher's eventual successor, in 1987.

Things Are Better Than Ever
Back to The Original Macintosh
Handicapped

Login
Account Name:

Password:

Create new account
Related Stories
Rating
Overall Rating: 4.79
(best)

Your rating:

  1

  2

  3

  4

  5
20 Comments     
This is amazing/concidental, as last week I was just looking at Switcher and other gems from that era. Is there potential for a story regarding Servant? And any comments regarding Multi-Mac (which is terribly difficult to find information about these days).
Hi Andy, Great story! Just a couple of notes on location and names, etc. The Byte office was actually at 100 Elwell Court in Palo Alto. I had an early IBM PC, which I had bought when I was at Infoworld. It probably had a hard disk by that time! Memory Shift was written by a good programmer named Peter something who I had met. He was working for one of the early PC add-in card companies. John Markoff
Wow! An authentic Bill Gates signature, suitable for easy duplication. Hackers are probably generating bogus checks and letters right now. Probably won't be long before Bill has a lawyer telling you to ceast and desist publishing this jpeg...
Andy, This is a great story. I'm not sure where what I'm about to tell falls in it but undoubtedly toward the end. A group of us had come down to Macworld Expo in San Francisco from Eugene and we were walking around the show floor when I spotted you. I didn't know you except from pictures but there you were, walking around the show floor with your backpack on. Understand that to us, the original Mac team were like superheros and to actually be near one was pretty amazing. I walked over, tapped you on the shoulder and said "hi Andy" and you said, "hi, are you guys serious Mac users? If so, I have something I want to show you." I said that we were and you walked over to the nearest booth which happened to be the MacBottom booth (early HD that sat under the Mac) and asked if you could use one of their machines. The guy in the booth hesitated but we all simultaneously told him that you were "you" and he calmed down. You were talking a mile a minute while loading the contents of a single disk into the Mac. Then you were messing around with stuff we'd not seen before (setting up a switcher set) and then you said, "check this out." You hit the little arrow and the screen shifted from MacPaint to MacWrite and you hit it again and it came back to MacPaint. You said "So, what do you think?" We were speechless. Unlike the others in my group, I had used Memory Shift on a PC and had a sense of what you were doing but still, the animation made it so much better. After we told you we loved it you reached into your pack and gave each of us a disk with Switcher on it. It wasn't shipping yet and you asked for our feedback. I still have that disk Andy and will always remember how wonderful it was to experience your generosity and enthusiasm for something you enjoyed making and sharing. Thank you for being you.
Great Story! You should show the world more of these great innovations, which led Apple with MacOS to be the best OS ever!
I just noticed that there is a mis-spelling in Gates' mail. It reads "Andy Herzfield" instead of "Andy Hertzfeld"..
Hi Andy, First off, let me tell you that you are one of my computing idols! Well, I just wanted to say that I think it was quite unfair of Steve Jobs to deny adequate compensation for employee's efforts, for example this incident and the one where you guys hooked up a mouse to an Apple ][. Lot nice of you to go on and make the Macintosh a much better operating system... you guys started it all and thats what matters. Regards, Absar Shah AbsarShah@gmail.com
There's a few more images showing switcher in operation here: http://www.mac512.com/switcher.htm
As I was graduating from the Univ. of Washington in 1984, the Mac was being released. I told my parents that, somehow, I was buying a Mac, and they ended up getting me a 128K Mac and the Imagewriter as a PhD graduation present. One year later (more or less,dates are hazy now) Dr. Dobbs Journal published the famous "hack it yourself" 128K to 512K upgrade article. I was now working at a government lab outside Washington, DC, but my friends back in the Physics Dept. at UW had done 3 or 4 "Fat Mac" upgrades and it worked! Chip prices were falling, I realized that I could get the parts for about $200, something a postdoc could afford. So, I bought the (then very weird) "Torx wrench" tool, opened the Mac case, wrapped the motherboard in Al foil, packed in my carry-on bag and when I had a trip to Seattle, went to the Physic dept. We did the surgery, put the motherboard in a test Mac, and it worked. This is a Switcher story, because the first thing we did was run Switcher, which I had heard about, but couldn't run without the 512K memory. I had never -seen- Switcher before. The moment I saw one program slide off the screen and another slide on....that was the moment that I knew that my instincts about the Mac had been right, that this was a computer that would change computing for good. My hat's off to the miracles that the original team pulled off in those days. We owe you all a great debt.
Great work Andy and I look forward to reading your book. For the rest of you here is a site that talks more about Andy's Servant and Multi-Mac applications that were closely linked to Switcher. http://homepage.mac.com/senorwences/servant_page/servant_introduction.html
Excellent article on an excellent site! I look forward to picking up a copy of Revolution as soon as I land another job! BTW, dunno if you spend much time in Macland anymore, but there's a neat OSX.3 app that is reminiscent of Switcher.. http://wsmanager.sf.net It basically handles desktop paging using the Panther multi-user transitions, and for me is the last remaining thing keeping me from running OS X at both home and work. ps: Interesting comment on the Mac mini at macintouch: "More than two decades ago, the original designers of the Macintosh envisioned a $500 appliance computer that exemplified simplicity. The Mac Mini is just that, at exactly that price. Mac OS X has lost some of the software elegance and consistency of the original system, but the Mac Mini is still the finest example of those principles on the market today." Only took 20 years!
My first computer was a Mac 512 and I eagerly attended New York Mac User Group meetings to learn about this amazing machine. I was in the NYMUG audience as Andy demo'd Switcher. My memory is that about 500 people, mostly men, attended the NYMUG meeting that night in a big CUNY auditorium on 42nd St. And, after Switcher was shown to us, I remember I jumped to my feet along with everyone else, screamed and holler'd with amazement and joy, realizing how much time this would save. I seem to have a memory that men were hugging but perhaps I won't go that far. But that demo got the most enthusiastic reception I have ever seen. Thanks, again, Andy! Gratefully, Steve Carlson
This video "Smackbook" reminds me SO MUCH of Switcher, and I think you'll see why: http://www.youtube.com/watch?v=6uvQTTPr9Rw Too bad there weren't accelerometers in the Mac 512 so you could make an interface like that to switch between applications.
Was it ever revealed who was "Jwa van der Vuurst", supposed author of Multi-Mac? I remember getting a "secret" demo of Multi-Mac when it started making the rounds, one night in the labs of Beck-Tech at the Claremont Hotel in Berkeley. The demo showed a simple line drawing of a car going around and around a track that circled a pillar, while another application ran behind this window. Very impressive, even though the movement of the car was jerky.
I really enjoyed that story. You're an excellent writer. Thanks for sharing.
The MacOS X Lion Preview page proudly announces: "On iPad, every app is displayed full screen, with no distractions, and there’s one easy way to get back to all your other apps. Mac OS X Lion does the same for your desktop. You can make a window in an app full screen with one click, switch to another app’s full-screen window with a swipe of the trackpad, and swipe back to the desktop to access your other apps — all without ever leaving the full-screen experience. Systemwide support allows third-party developers to take advantage of full-screen technology to make their apps more immersive, too. So you can concentrate on every detail of your work, or play on a grander scale than ever before." ... ever before since Switcher, that is.
I was the author of Multi-Mac. No, I didn't work for Apple, but I did demo it to Apple at the time. I had bought a mac-512 in 1985, and got frustrated by the performance of the floppy disk. I had a lot of experience back in Holland disassembling z80 machines and implementing my own OS(JWA-Forth) on them. So it wasn't too hard to disassemble the ROMs of the mac. My first patch was to implement a disk caching system and also allow it to cache floppies that where not in the drive. So you wouldn't have to swap floppies all the time. Then I got this idea. The desk accessories where able to run in parallel to the application. Every application would call SystemEvent. So i made each application look like a desk accessory to the other applications. The one problem left was memory management. Since the mac was only using 24 bit addressing, i used the upper 8 bits in each handle to remember who owned the allocated memory. The running application would have the bits set to 0. New memory allocated defaults in that state. Switching to a different app required patching the upper 8 bits of every memory handle. 0 -> active app# and next app# -> 0. It actually worked really well. I demo-ed it at apple and had 5 apps running at the same time, using 2 floppy disks on one drive. It would calculate the next chess move in the background while running MacWrite in the foreground and keep spreadsheets and other programs running in the background. While Apple was very impressed, they had no interest in buying it (Andy didn't thing my memory handling would be very stable), and I knew that releasing it would have me having to keep up with all the new ROM releases from Apple in the future. We had a small company(IIS) at the time that was writing Insurance software for the HHC (from Friends Amis)and really couldn't do without me. We did come up with a great marketing phrase at the time though: "Now your Mac can walk and chew gum at the same time!" My name is Johannes Willem Antoon van der Vuurst (Hans), jwa@dms.net if you have any questions.
While a Mac 128k was my first computer, its more than a dozen years since I've been a serious mac user but the Macbook Air and Lion lured me back. I was just telling a long-time mac fan friend how 4-finger swipe between desktops reminded me of Switcher. "Switcher?" he said - so off I went searching for a reference. Great article - great memories. Thanks!
I'm amazed, I just noticed the current Mac OS X mouse cursor didn't even changed a pixel in all those years, compared to the screenshot version!
This story is available as an MP3: https://macfolkloreradio.com/2019/03/15/mfr011-folklore-switcher.html