Sealing the Holes: How 'Doctor Zhivago' Inspires Durable Software Fixes
Share this article
Rats, Revolution, and Regression: A Siberian Parable for Engineers
In Boris Pasternak's Doctor Zhivago, the protagonist's Siberian exile reveals a universal truth: chasing rats from a house with a broom offers momentary relief, but they return through unsealed holes. This metaphor perfectly mirrors software engineering's eternal struggle—quick fixes address symptoms, not systemic flaws. As Aleksey Kladov (matklad) observes, our projects face similar "rats": recurring bugs, bitrotten tests, and decaying documentation that resurface despite heroic efforts.
"It’s important not only to fix things, but to fix them in a durable way; to seal up the holes, not just to wave the broom vigorously."
— matklad
The Ratchet Principle: Engineering Irreversible Progress
The antidote? Kladov proposes the ratchet mechanism: a "not rocket science" rule that enforces incremental, irreversible quality gains. Unlike grand refactoring plans, ratchets work through small, automated checks that lock improvements into place:
- Identify a target property (e.g., "all files must have documentation").
- Create a test that flags violations except an explicit "naughty list" of existing exceptions.
- Commit the test first—progress begins immediately by preventing new violations.
# Simplified ratchet example for documentation coverage
naughty_list = {'legacy_file.py', 'deprecated_module.rs'}
for file in project_files:
if file not in naughty_list and lacks_docstring(file):
fail_test(f"Undocumented file: {file}")
This transforms tech debt into actionable, bite-sized tasks: remove one file from the naughty_list after adding docs, and the improvement becomes permanent.
Beyond Code: Ratcheting Cultural Practices
Not all fixes can be automated. For team practices like design reviews, Kladov advocates:
- Document actual workflows (not aspirational ideals) in version-controlled markdown.
- Prune contradictions aggressively: If reality diverges, update docs to match. A small, truthful guideline beats an ignored manifesto.
Why Ratchets Outperform Heroics
- Incremental adoption: Teams improve systems gradually without massive rewrites.
- Regression armor: Automated checks prevent backsliding (e.g., "this performance fix won't degrade unnoticed").
- Psychological wins: Each notch upward on the ratchet delivers tangible progress, fueling momentum.
Like Zhivago's succinct chapters, ratchets thrive on small, sustainable steps. They reject the false choice between "fix everything now" and "live with chaos"—instead building resilient systems where quality compounds. Stop chasing rats. Start sealing holes.
Source: Of Rats and Ratchets by Aleksey Kladov (matklad)