# Source Code

## Metadata
- Author: [[Bill Gates]]
- Full Title: Source Code
- Category: #books
- Summary: Bill Gates and his friends discovered computers at Lakeside School, where they spent their free time programming and exploring technology. This passion led Gates to collaborate with Paul Allen, and together they envisioned starting their own software company. Their early experiences with computers and programming shaped their future, ultimately leading to the creation of Microsoft, one of the world's largest companies.
## Highlights
- Toward the end of my sophomore year, in June 1971, Mike called me with our next trip: fifty miles in the Olympic Mountains. The route he chose was called the Press Expedition Trail, after a group sponsored by a newspaper that had explored the area in 1890. Did he mean the same trip on which the men nearly starved to death and their clothes rotted on their bodies? Yes, but that was a long time ago, he said.
Eight decades later it would still be a tough hike; that year had brought a lot of snow, so it was a particularly daunting proposition. ([View Highlight](https://read.readwise.io/read/01jv12xt0fsmve23vpz5qx53v6))
- I remember this trip for how cold and miserable I felt that day. I also remember it for what I did next. I retreated into my own thoughts.
I pictured computer code. ([View Highlight](https://read.readwise.io/read/01jv12w21tatgqdwqe98fftyrr))
- Around that time, someone had loaned Lakeside a computer called a PDP-8, made by Digital Equipment Corp. This was 1971, and while I was deep into the nascent world of computers, I had never seen anything like it. Up until then, my friends and I had used only huge mainframe computers that were simultaneously shared with other people. We usually connected to them over a phone line or else they were locked in a separate room. But the PDP-8 was designed to be used directly by one person and was small enough to sit on the desk next to you. It was probably the closest thing in its day to the personal computers that would be common a decade or so later—though one that weighed eighty pounds and cost $8,500. ([View Highlight](https://read.readwise.io/read/01jv130tj767308v1r3963jkxp))
- For a challenge, I decided I would try to write a version of the BASIC programming language for the new computer. ([View Highlight](https://read.readwise.io/read/01jv130y08wy31gbeqmq4wyrab))
- Before the hike I was working on the part of the program that would tell the computer the order in which it should perform operations when someone inputs an expression such as 3(2 + 5) x 8 − 3, or wants to create a game that requires complex math. In programming that feature is called a formula evaluator. Trudging along with my eyes on the ground in front of me, I worked on my evaluator, puzzling through the steps needed to perform the operations. Small was key. Computers back then had very little memory, which meant programs had to be lean, written using as little code as possible so as not to hog memory. The PDP-8 had just 6 kilobytes of the memory a computer uses to store data that it’s working on. I’d picture the code and then try to trace how the computer would follow my commands. The rhythm of walking helped me think, much like a habit I had of rocking in place. For the rest of that day my mind was immersed in my coding puzzle. As we descended to the valley floor, the snow gave way to a gently sloping trail through an old forest of spruce and fir trees until we reached the river, set up camp, ate our Spam Stroganoff, and finally slept. ([View Highlight](https://read.readwise.io/read/01jv12wx242hrpkh109xhvj1bm))
- Like the famous line “I would have written a shorter letter, but I did not have the time,” it’s easier to write a program in sloppy code that goes on for pages than to write the same program on a single page. The sloppy version may also run more slowly and use more memory. Over the course of that hike, I had the time to write short. On that long day I slimmed it down more, like whittling little pieces off a stick to sharpen the point. What I made seemed efficient and pleasingly simple. It was by far the best code I had ever written. ([View Highlight](https://read.readwise.io/read/01jv12yqy1ge0jxpxrdds28pts))
- I never finished my BASIC project. But the code I wrote on that hike, my formula evaluator, and its beauty stayed with me.
Three and a half years later, I was a sophomore in college not sure of my path in life when Paul, one of my Lakeside friends, burst into my dorm room with news of a groundbreaking computer. I knew we could write a BASIC language for it; we had a head start. The first thing I did was to think back to that miserable day on the Low Divide and retrieve from my memory the evaluator code I had written. I typed it into a computer, and with that planted the seed of what would become one of the world’s largest companies and the beginning of a new industry. ([View Highlight](https://read.readwise.io/read/01jv12zjewh0zkg6sgvedpd7rj))
- Russia’s 1957 *Sputnik* launch jolted the United States into pouring money into science and technology, giving birth to NASA and what was then called the Advanced Research Projects Agency. Some of that money found its way into downtown Seattle, where the city was planning to host the next World’s Fair, dubbed “Century 21.” The exposition quickly morphed into a retort to Russia, a showcase of America’s scientific prowess and vision for its future in space, transportation, computing, medicine, and its role as a global peacemaker. ([View Highlight](https://read.readwise.io/read/01jv12rm7agrr7vp9t5beh7xns))