The Pragmatic Programmer Part 4 - Practice Productive Paranoia
Pragmatic paranoia is not anxiety. It is the discipline of accepting that systems fail and making sure failure does not rot silently.
This is part 4 of an eight-part reading series on The Pragmatic Programmer. It covers Chapter 4 · Pragmatic Paranoia.
I use the same operating principle as my Korean notes: notes are storage, insight cards are currency.
L0 · Entry
- Core idea: Safe code does not deny failure; it lets failure speak.
- Why I picked this book: as AI writes more code, I want a clearer standard for what the developer still has to judge, explain, and verify.
- Initial assumption: I expected an older collection of programming advice. What remains is closer to an operating system for professional judgment.
- Scope: Design by Contract, Dead Programs Tell No Lies, Assertive Programming, When to Use Exceptions, How to Balance Resources
- Question: How can we build code that reveals failure early instead of pretending nothing went wrong?
L1 · Captures
- This chapter can be read through the question: How can we build code that reveals failure early instead of pretending nothing went wrong?
- Useful English terms:
design by contract·assertive programming·fail fast - I avoid long quotations here and use paraphrase because the source is a copyrighted book.
L2 · Chapter Map
| Scope | My label | Core question |
|---|---|---|
| Chapter 4 · Pragmatic Paranoia | Practice Productive Paranoia | How can we build code that reveals failure early instead of pretending nothing went wrong? |
Contracts make expectations between modules explicit. Hidden failure grows; visible failure can be narrowed. Assertions turn impossible assumptions into executable checks. Exceptions belong to genuinely exceptional flows. Resource management is the discipline of releasing what we acquire.
L3 · Insight Cards
1. A contract is executable expectation, not documentation
When a function states what it expects and guarantees, both humans and agents get clearer boundaries for change.
2. Failing fast is not unkind to users
Silent data corruption and late explosions are more hostile. A system that stops early is a system that can be repaired.
3. Resource leaks resemble attention leaks
A file opened and never closed resembles a task started and never concluded. Both consume memory.
L4 · Production Board
- Write preconditions and postconditions for one important function.
- Replace one catch-all exception path with a narrower error boundary.
- Test one acquire-and-release resource pattern.
Prompt template
1 | Review the following software task through The Pragmatic Programmer lens. |
L5 · Review
This chapter connects to Clean Code, Refactoring, and my current LLM Wiki experiment. The durable question is not which tool is fashionable, but how a developer chooses, changes, verifies, and communicates work.
- Open question: when AI generates more of the code, where does pragmatic responsibility move?
- Final takeaway: Safe code does not deny failure; it lets failure speak.
댓글
GitHub 계정으로 의견을 남길 수 있습니다. 댓글은 GitHub Discussions에 저장됩니다.