Spinning Plates: What this Parlor Trick Has in Common with Software Development
The fewer items you need to mentally track the less likely you are to make mistakes or generate bugs.
I've often used the metaphor that software development is like juggling.
Each chunk of information represents a ball that you need to keep in the air. Juggling one or two balls is easy, but each additional ball you need to keep in the air gets exponentially harder. This metaphor is useful insofar as it encourages us to manage complexity by reducing the number of balls we need to mentally juggle at any one time.
The Rule of Seven
Never try to juggle more than seven mental balls.
While the juggling metaphor is useful, a better metaphor for software development is plate spinning.
Plate Spinning
Plate spinning was a staple of 1960's variety shows like The Ed Sullivan Show.
The act involves spinning multiple plates atop long, thin wooden poles. When the plate first started spinning, it would appear nearly flat. The plate would wobble as it slowed down. If it slowed too much, it would fall.
A key part of the act requires tending to wobbling plates.
Getting the first few plates spinning is easy. But once you get four or five plates going, you have to go back and tend to the first few plates before you can add plate six or seven. And once you get seven plates spinning, you have to tend to the first five plates before you can spin your eighth plate.
The time it takes to add spinning plates gets exponentially longer, as each additional plate requires tending to more plates that are already spinning.
The YouTube clip below is a good example of the genre:
Metaphor Showdown: Juggling vs. Plate Spinning
Similar to the juggling metaphor, each spinning plate represents a chunk of information.
However, there are some key differences between the two metaphors that make me think plate spinning is generally a better analogy for software development:
- Loading chunks of information
- Physiological limits
- Maintaining the information
Loading Chunks of Information
Juggling requires tossing every ball in the air nearly simultaneously; the last ball must be in the air before the first ball lands back in your hand.
Plate spinning requires adding plates one at a time; already-spinning plates require attention to keep them from wobbling and crashing to the ground.
When we orient ourselves to an existing code base, we don't just glance at the code and immediately know what all of the important pieces are. Instead, we need to understand:
- What global variables are relevant for the current operation?
- Are there tables involved? If so, what are the fields? What are the field types?
- What events does the current form handle? What effect(s) might they have?
- How does the current operation fit into the overall design of the system?
- Etc.
By the time you get to figuring out how the current operation fits into the overall system, you may be unsure of the data type of a relevant field. So now you have to go back to the table design view and refresh your memory.
Just like the entertainer spinning a wobbling plate.
Physiological Limits
The forces of gravity and the physical limits of the human body impose severe constraints on how many balls a person can juggle at one time.
Plate spinning is a different matter.
The juggling world record is 11 balls, while the plate spinning world record is 108 plates. While our short-term memory is restricted to about seven items, our long-term memory has greater capacity. However, retrieving items from long-term memory takes longer than from short-term memory.
When working in a code base with many interdependencies, it's not unusual to need to load dozens of chunks of information into our memory at one time to be sure that we are not missing anything. As with plate spinning, this is something that our brains can handle, just not very efficiently.
Maintaining the Information
With juggling, every piece of information requires an equal amount of attention. You cannot deprioritize a juggled ball without it falling to the ground.
With plate spinning, we can prioritize some pieces of information over others. We can allow some plates to wobble more excessively than others allowing us to focus our attention on the plates that are most important. This distinction becomes important when we start talking about things like exploring a new code base.
Reading through someone else's code is the ultimate plate-spinning exercise.
As you familiarize yourself with the code base, you are constantly spinning up new plates. For some plates (i.e., "chunks of information"), it's enough to be aware that they exist. For others, you need to pay more careful attention.
For example, you may need to know what fields are in a table, but you don't need to memorize them. On the other hand, a variable making its way through a series of complex calculations is something you better be able to keep track of mentally without risking a wobble or crash.
The Common Thread: Managing Complexity
Despite the differences between these two metaphors, they share one important characteristic:
The fewer items you need to mentally track the less likely you are to make mistakes or generate bugs.
Additional Reading
Cover image created with Microsoft Designer