Meet the New Guard of Finance—and Save $100 On Your First YearUnlock the List

Art by Clark Miller

How I Learned to Code

By  |  Aug. 11, 2022 9:00 AM PDT
Photo: Art by Clark Miller

On my first day of class at Harvard, at the end of a lackluster economics lecture, I was shoving my stuff into my backpack when electronic music started blasting through the speakers. The beat seemed to shake the chandelier. A sans serif logo appeared projected at the head of the room: CS50, Introduction to Computer Science. I had nowhere to be, so I stayed. At seven minutes after the hour (“on Harvard time”) the lecturer, David Malan, tested the mic clipped to his black sweater and strode into the spotlight to teach us how to program.

He demonstrated our first algorithm—binary search—by looking for the name Mike Smith in a phone book. Malan flipped to a spot in the middle: too early in the alphabet. “So what do we do?” he asked. A row of teaching fellows onstage ripped tomes in half and threw them to the floor. The audience gasped. Malan’s assistants picked new pages and repeated the procedure. Finally, the head teaching fellow held up a single page, triumphant. The crowd applauded and hollered.

It took less than a minute, although Malan drew it out for dramatic effect. If the phone book had 1,000 pages, it only took an average of 10 tearings to find the right one: 500 pages, then 250, 125, 62, 31, 16, 8, 4, 2, then 1. He said something about logs—1024 log base 2 is 10—but I couldn’t think about math, only about magic. I stared at the resulting single page slack-jawed, transfixed.

Get access to exclusive coverage
Read deeply reported stories from the largest newsroom in tech.
Latest Articles
Creator Economy startups
Gumroad Turns a Profit After Price Hike
Photo via Gumroad
Gumroad, which provides tools to creators including landing pages and help with product sales, recorded the largest monthly profits in its 11-year history in recent months after raising prices.Gumroad recorded net income of $82,270 in January, Sahil Lavingia, Gumroad’s founder and CEO, told its crowdfunding investors and creators Thursday in a presentation that was available via Zoom. Net...
Latest Briefs
Coinbase Hires Former Shopify Executive as Country Director
Circle’s USDC Outflows Exceed $10 Billion Since Crypto Bank Crisis
Virgin Orbit Lays Off 85% of Staff, Ceases Operations
Stay in the know
Receive a summary of the day's top tech news—distilled into one email.
Access on the go
View stories on our mobile app and tune into our weekly podcast.
Join live video Q&A’s
Deep-dive into topics like startups and autonomous vehicles with our top reporters and other executives.
Enjoy a clutter-free experience
Read without any banner ads.
From left, Alphabet CEO Sundar Pichai, DeepMind CEO Demis Hassabis and Google Brain chief Jeff Dean. Photos by Getty, Bloomberg
Exclusive google ai
Alphabet’s Google and DeepMind Pause Grudges, Join Forces to Chase OpenAI
OpenAI’s success in overtaking Google with an artificial intelligence–powered chatbot has achieved what seemed impossible in the past: It has forced the two AI research teams within Google’s parent, Alphabet, to overcome years of intense rivalry to work together.
Art by Clark Miller.
Opinion startups
Don’t Build the Wrong Kind of AI Business
At a catch-up coffee a few weeks ago, a founder friend asked me, “What AI thing should we build?” It was the third time that week a founder had asked me the same question.
Block chairman and co founder Jack Dorsey. Photo by Getty
Fintech’s Big Wakeup Call
Fintechs were supposed to transform banking by making it dead simple for users to open savings accounts or pay their bills.
Art by Clark Miller.
Market Research e-commerce culture
The Skin-Tech Devices Helping Execs Beautify in a Hurry
I’m always 29 at heart,” said Liyia Wu, CEO of ShopShops, a livestream shopping app for fashion, beauty and lifestyle products.
Art by Clark Miller
Surreal Estate real estate
Silicon Valley’s Realtors, Like Its Bankers, Are Having a Tough Month
In early March, Ken DeLeon, founder of DeLeon Realty, a Silicon Valley–based brokerage that sold more than $1 billion in homes in 2021, called one of his venture capitalist clients to discuss the purchase of a $20 million–plus megamansion.
Art by Clark Miller.
Caffeinated Capitalists venture capital
Venture Capital’s 25 Favorite Cafes
Coupa Cafe in Palo Alto. Buck’s of Woodside. The Creamery in SoMa (RIP). Silicon Valley’s coffee shops have undoubtedly seen more dealmaking than any one fancy office building or members’ club.