Software Design Red Flags: wisdom nuggets from John Ousterhout
Tags: software, design
Published: 2021-04-16 11:54:45

---
title: Software Design Red Flags: wisdom nuggets from John Ousterhout
published: true
description: Very short, well-articulated and pragmatic, Ousterhout’s nook manages to explain the rationale behind many practices we usually learn with experience, yet are often not able to articulate clearly. 
tags: software,design
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4qjhvje3bhm2l5kjydnh.jpg
canonical_url: https://notes.portebois.net/2021/03/04/13.html
---



[John Ousterhout’s _A Philosophy Of Software Design_](https://www.goodreads.com/en/book/show/39996759) is one of my favourite software design books.

Very short, well-articulated and pragmatic, Ousterhout manages to explain the rationale behind many practices we usually learn with experience, yet are often not able to articulate clearly.

I’ll write a new, complete, review of the book one day to replace the private one I wrote and lost...
but in the meantime, some recent discussions made me realize that the few _red flags_ John Ousterhout scatters throughout the book are very valuable nuggets, which convey a lot of important ideas in very few sentences.

And since the book is only available in a paper edition, I usually have a hard time sharing them with friends and colleagues.

Without further ado, here are all the Software Design Red Flags from _A Philosophy of Software Design_.  
I hope this little glimpse will be the nudge you need to get your own copy of the book, and that you will enjoy it as much as I did.

----

> **Shallow Module** _(chapter 4.6)_  
> A shallow module is one whose interface is complicated relative to the functionality it provides.  
> Shallow modules don’t help much in the battle against complexity, because the benefit they provide (not having to learn about how they work internally) is negated by the cost of learning and using their interfaces. Small modules tend to be shallow.


----

> **Information leakage** _(chapter 5.2)_  
> Information leakage occurs when the same knowledge is used in multiple places, such as two different classes that both understand the format of a particular type of file.

----

> **Temporal decomposition** _(chapter 5.3)_  
> In temporal decomposition, execution order is reflected in the code structure: operations that happen at different times are in different methods or classes.  
> If the same knowledge is used at different point in execution, it gets encoded in multiple places, resulting in information leakage.

----

> **Overexposure** _(chapter 5.7)_  
> If the API for a commonly used feature forces users to learn about other features that are rarely used, this increases the cognitive load on users who don’t need the rarely used features.

----

> **Pass-Through Method** _(chapter 7.1)_  
> A pass-through method is one that does nothing except pass its arguments to another method, usually with the same API as the pass through method.  
> This typically indicates that there is not a clean division of responsibility between the classes.


----

> **Repetition** _(chapter 9.4)_  
> If the same piece of code (or code that is almost the same) appears over and over again, that’s a red flag that you haven’t found the right abstractions.

----

> **Special-General Mixture** _(chapter 9.5)_  
> This red flag occurs when a general-purpose mechanism also contains code specialized for a particular use of that mechanism.  
> This makes the mechanism more complicated and creates information leakage between the mechanism and the particular use case:  
> future modifications to the use case are likely to require changes to the underlying mechanism as well.

----

> **Conjoined Methods** _(chapter 9.8)_  
> It should be possible to understand each method independently.  
> If you can't understand the implementation of method without also understanding the implementation of another, that's a red flag.  
> This red flag can occur in other contexts as well: if two pieces of code are physically separated, but each can only be understood by looking at the other, that is a red flag.


----

> **Comment Repeats Code** _(chapter 13.2)_  
> If the information in a comment is already obvious from the code next to the comment, then the comment isn’t helpful.  
> One example of this is when the comment uses the same words that make up the name of the thing it is describing.

> **Implementation Documentation Contaminates Interface** _(chapter 13.5)_  
> This red flag occurs when interface documentation, such as that for a method, describes implementation details that aren’t needed in order to use the thing being documented.

----

> **Vague Name** _(chapter 14.3)_  
> If a variable or method name is broad enough to refer to many different things, then it doesn’t convey much information to the developer and the underlying entity is more likely to be misused.

  
----

> **Hard to Pick Name** _(chapter 14.3)_  
> If it’s hard to find a simple name for a variable or method that creates a clear image of the underlying object, that’s a hint that the underlying object may not have a clean design.

 
----

> **Hard to Describe** _(chapter 15.3)_  
> The comment that describes a method or variable should be simple and yet complete.  
> If you find it difficult to write such a comment, that’s an indicator that there might be a problem with the design of the thing you are describing.

----

> **Nonobvious Code** _(chapter 18.2)_  
> If the meaning and behavior of code cannot be understood with a quick reading, it is a red flag.  
> Often this means that there is important information that is not immediately clear to someone reading the code.

----

To be continued with a full review of the book... soon.

banner: my own copy. Obviously, a few sections caught my attention

_Originally published on [notes.portebois.net](https://notes.portebois.net/2021/03/04/13.html)_