Knowledge
Search knowledge... ⌘K
Knowledge · Anti-Patterns
Programming By Coincidence
Anti-pattern of relying on accidental behavior without understanding why code works
Tags
craftsmanshipanti-patternsreliabilitymaintainabilitypragmatic-programmer
Impact
Programming by Coincidence is when code works, but you don't know why. It might work due to lucky timing, accidental ordering, or undocumented behavior. When underlying assumptions change, the code breaks mysteriously. This anti-pattern leads to fragile, hard-to-debug systems.
Symptoms
- Programming by Coincidence is when code works, but you don't know why. It might work due to lucky timing, accidental ordering, or undocumented behavior. When underlying assumptions change, the code breaks mysteriously. This anti-pattern leads to fragile, hard-to-debug systems.
Related
- Deliberate Programming
- Documentation
Source
David Thomas, Andrew Hunt — The Pragmatic Programmer: Your Journey to Mastery(2019)