John Ousterhout Google Talk


John Ousterhout Google Talk

Corey
Hope, have you ever thought about how we teach software design? I mean, we’ve been programming for over 80 years, yet it’s still basically a black art. There’s almost no agreement on what good software looks like or how to design it.

Hope
It’s true. We spend tons of time on tools, testing, and processes, but the actual act of designing software? That’s just something you’re supposed to pick up on your own. John Ousterhout gave a talk at Google where he argued we need to change that.

Corey
Right. He said the most important concept in all of computer science is problem decomposition — how to chop a complicated problem into pieces you can build independently. And yet, no course really teaches that. That’s what he set out to fix.

Hope
He created a course at Stanford called CS 190 Software Design Studio. Instead of lectures, it’s built around iterative design and code reviews — kind of like learning to write in high school.

Corey
Exactly. Students work in pairs and build a system in three weeks. Then everyone reads each other’s code, and Ousterhout himself reads every line — about 20,000 to 30,000 lines per phase. They do three cycles of project, review, and revision.

Hope
That’s a huge investment. But he believes the feedback is where the real learning happens. Students see how their design choices cause complexity, and they learn to fix it. He also talks about a set of design principles and red flags to guide them.

Corey
One of the key principles is that classes should be deep. Think of a class as a rectangle: the area is the functionality it provides, and the top edge is its interface — the cost to use it. You want a small interface and a lot of hidden functionality.

Hope
That’s the opposite of what many people do. They create shallow classes with tiny interfaces and little hidden complexity — like a method that just calls another method with no added value. That doesn’t help you manage complexity at all.

Corey
Ousterhout calls that 'classitis' — the idea that more small classes are better. He gave the example of the Java Class Library, where opening a file for reading serialized objects requires three separate objects: file stream, buffering, and serialization. That’s a lot of overhead for a common task.

Hope
Instead, he argues for deep abstractions. His favorite example is the Unix file I/O interface: just five functions — open, read, write, close, and lseek. Behind that simple interface, there are hundreds of thousands of lines of code managing disks, caches, and device drivers.

Corey
That’s beautiful. And it’s not just about classes — it applies to methods, modules, anything with an interface. He says length isn’t the problem; it’s whether the interface hides complexity effectively.

Hope
Another principle he emphasizes is to define errors out of existence. Exceptions are a huge source of complexity, and a lot of code exists just to handle them. The best way to deal with an exception is to make it impossible for it to occur.

Corey
He gave several examples. In the Tcl scripting language, the unset command originally threw an exception if you tried to delete a variable that didn’t exist. But people commonly clean up by trying to delete variables they might not have created, so that exception was a nuisance. He should have just made unset a no-op for non-existent variables.

Hope
And file deletion. In Windows, trying to delete a file that’s in use gives an error — and you end up hunting down which process has it open. Unix solves it by removing the directory entry immediately but keeping the file’s data alive until the last handle closes. No error for the deleter, no error for the active user.

Corey
Even Java’s substring method throws exceptions for out-of-bounds indices. Ousterhout thinks it should just return the overlap — if both indices are out of range, return an empty string. That would eliminate countless runtime exceptions and extra range-checking code.

Hope
But some people argue that exceptions help catch bugs. He counters that making the common case simple and safe is more important — you still have unit tests to catch logical errors. The goal is to minimize the number of places where exceptions have to be handled.

Corey
That ties into a bigger mindset issue. Ousterhout contrasts two programming styles: tactical and strategic. In the tactical approach, your only goal is to get something working. You take shortcuts and add kludges, thinking you’ll clean them up later — but you never do.

Hope
And complexity builds up. It’s not one big mistake; it’s hundreds of small ones made by many people over time. Once the code base becomes a spaghetti mess, it’s nearly impossible to fix. Ousterhout calls the extreme version a 'tactical tornado' — someone who churns out shoddy code quickly, leaving destruction behind.

Corey
Sadly, these people are often seen as heroes by management because they deliver features fast. But in the long run, they slow the whole team down. The strategic approach, on the other hand, prioritizes good design. You invest a little extra time up front to keep the system clean, knowing it will pay off in future development speed.

Hope
The challenge is that the benefits are delayed — you see the cost today, but the payoff comes months later. Ousterhout estimates the crossover point is around 6 to 12 months. He suggests investing about 10% to 20% of your time in design improvements, which almost any team can afford.

Corey
He also advises taking small steps, not trying to design everything upfront. When you add a new feature, take time to design a clean interface. Write documentation and unit tests as you go. And when you modify existing code, look for opportunities to improve the design — not just the minimal change to get the job done.

Hope
One thing he learned from teaching the course is that making classes slightly more general-purpose, even if you only use them in one place, often leads to shallower interfaces and simpler code. He changed his own views because of student projects.

Corey
That’s the value of iterative review. Ousterhout wrote a short book — 'A Philosophy of Software Design' — to spread these ideas. He hopes it sparks a conversation and that the community will contribute better principles and examples over time.

Hope
He’s realistic though. The course isn’t scalable — he reads all the code himself. And changing the culture of an entire industry takes time. But he believes we can teach software design, and that even a little awareness can make a huge difference.

Ask anything
We've read this whole study set, so questions about it get the best answers.