John Ousterhout Google Talk
- 22Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is the single most important concept in all of computer science according to the speaker?
22 questions
- 1
What is the single most important concept in all of computer science according to the speaker?
Model answer
Problem decomposition: how to take a complicated problem or system and chop it up into pieces that can be built relatively independently.
Explanation
The speaker argues that problem decomposition is the most important concept because it underpins all of computer science, yet it is rarely taught explicitly.
- 2
Explain the difference between a deep class and a shallow class.
Model answer
A deep class has a simple interface but provides a large amount of functionality underneath. A shallow class has a complex interface relative to its functionality, offering little benefit and often adding net complexity.
Explanation
Deep classes are good abstractions that hide complexity; shallow classes expose too much detail and require users to understand the implementation.
- 3
What is classitis?
Model answer
Classitis is the tendency to create many small, shallow classes, often driven by the mistaken belief that more classes are better. It leads to overly complex systems with many tiny interfaces.
Explanation
The speaker cites the Java Class Library as a prime example, where multiple objects are needed for simple operations like reading a file.
- 4
Why are shallow classes considered problematic?
Model answer
Shallow classes add complexity without providing significant benefit; they fail to hide much information and their interfaces are as complex as the implementation, yielding little leverage against complexity.
Explanation
In the worst case, a shallow class can be a net negative, increasing overall complexity.
- 5
Provide an example of a deep interface from the talk.
Model answer
The Unix file I/O interface, with only five basic functions (open, read, write, close, etc.), hides hundreds of thousands of lines of code for disk management, caching, and device drivers.
Explanation
This interface is simple yet powerful, a hallmark of good abstraction.
- 6
What are 'red flags' in software design?
Model answer
Red flags are specific patterns or behaviors that indicate a design is likely wrong. They help beginners recognize problems even if they don't know the correct design.
Explanation
Examples include shallow classes, complex interfaces, and excessive exception handling.
- 7
What is the principle of 'defining errors out of existence'?
Model answer
Redesigning the semantics of an operation so that what was previously an error becomes normal behavior, thereby eliminating the need to handle exceptions.
Explanation
The best case is to make the error disappear entirely, simplifying both the implementation and usage.
- 8
Give an example from the talk where the principle of defining errors out of existence could be applied to a programming language command.
Model answer
The Tcl
unsetcommand: it should simply make a variable not exist, rather than throwing an error if the variable already doesn't exist.Explanation
This change eliminates the need for callers to wrap
unsetin exception handlers. - 9
How does Unix handle file deletion when a file is still open to avoid errors?
Model answer
Unix removes the directory entry immediately but keeps the file content until all open handles are closed, allowing processes to continue accessing the file.
Explanation
This avoids errors on both the deleting process and processes using the file, a clean solution that defines the error out of existence.
- 10
Why does the speaker argue that Java's substring method should not throw exceptions?
Model answer
Because it would be simpler to return the overlap of the requested range with the actual string (or an empty string) instead of throwing an exception for out-of-range indices.
Explanation
This would eliminate extra code to clip indices and reduce runtime exceptions, making the common case easier.
- 11
When is it appropriate to throw an exception, according to the speaker?
Model answer
When you fundamentally cannot carry out your contract with the caller, such as when an I/O operation fails and there is no meaningful return value.
Explanation
Exceptions should be reserved for truly exceptional cases where the operation cannot be completed, not for conditions that can be handled with a different semantics.
- 12
What is the tactical approach to programming?
Model answer
The tactical approach focuses on getting something working as quickly as possible, often taking shortcuts and introducing kludges. The goal is short-term functionality rather than long-term design quality.
Explanation
This mindset leads to accumulation of complexity because many small compromises build up over time.
- 13
What is a 'tactical tornado'?
Model answer
A programmer who produces huge amounts of shoddy code that mostly works, leaving a wake of destruction. They are often valued by management for delivering features quickly.
Explanation
The speaker notes that these individuals are common and often rewarded, even though their code is unsustainable.
- 14
What is the strategic approach to programming?
Model answer
The strategic approach prioritizes good design, investing extra time today to make future development faster. The goal is a great design, not just working code.
Explanation
This involves sweating the small stuff and having zero tolerance for accumulating complexity.
- 15
Why is the strategic approach considered an investment?
Model answer
Because going slightly slower initially is paid back later through faster development as complexity is kept under control. The speaker estimates a crossover period of 6–12 months.
Explanation
Without the investment, complexity grows and slows development, eventually making changes harder and slower.
- 16
According to the speaker, what percentage of resources should be invested in design improvement?
Model answer
About 10% to 20% of development resources should be allocated to maintaining and improving design, rather than solely building new features.
Explanation
This is a rough guideline; the speaker believes most organizations can afford this and will eventually get the investment back.
- 17
What is the main obstacle to good design according to the talk?
Model answer
Mindset: most programmers take a tactical approach instead of a strategic one, focusing on immediate results over long-term design quality.
Explanation
The speaker argues that without the right mindset, even good principles cannot be applied effectively.
- 18
How should one think about making changes to existing code, according to the speaker?
Model answer
When making changes, aim to leave the code better than you found it. Try to achieve the design you would have if building from scratch with current knowledge, and avoid taking shortcuts.
Explanation
This counteracts the natural tendency to introduce complexity; even breaking even requires improving something.
- 19
What is Hyrum's Law?
Model answer
Hyrum's Law states that with a sufficient number of users of an API, all observable behaviors—even those not promised—will be depended upon by someone.
Explanation
This law highlights the difficulty of changing APIs because users come to rely on incidental behaviors.
- 20
According to the speaker, what should be the primary hiring criteria?
Model answer
Hire for slope (ability to learn quickly) rather than y-intercept (past experience). The fastest learner is more valuable than someone who has exactly done the job before.
Explanation
The speaker believes that in fast-changing environments, the ability to adapt and learn is more important than specific experience.
- 21
What is the speaker's view on using threads in software design?
Model answer
Threads are unavoidable for many tasks but are very hard to program correctly. They are considered the 'next to worst' alternative, only slightly better than not using them in some cases.
Explanation
The speaker's earlier talk on threads was a reaction to their overuse; he is still not a fan but acknowledges their necessity.
- 22
How does the speaker view the impact of programming language on software design?
Model answer
Design principles are fairly universal across languages; language choice is a secondary factor. A good design can be achieved in any language, as demonstrated by the Unix file I/O interface in C.
Explanation
While some languages may have features that aid design, the fundamental principles transcend specific languages.

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