7±2 Reasons Psychology Will Help You Write Better Code
summary
Shows that cognitive tricks change concrete code decisions and catches real bugs: uses the stroop task and the gorilla selective attention demo to prove surprises hide in plain sight, cites the 7±2 working memory limit and uses chunking to simplify long parameter lists, reports a production bug caused by an http postMessage and fixes it by renaming to isReadyWithSideEffects, argues for mandatory cold code reviews rather than explained walkthroughs and demonstrates linters cannot replace clear naming.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 0:58The Speaker's Background
- 2:20Conveying Clear Intent
- 2:49Cognitive Psychology in Code
- 4:39Creating Better Names
- 6:53Framework Naming Examples
- 7:37Limiting Working Memory
- 9:07The Technique of Chunking
- 11:42Applying Chunking to Code
- 14:03Filtering Data and Noise
- 15:34Two Modes of Thinking
- 17:51Predictable Code
- 20:02Importance of Code Reviews
- 21:26Selective Attention Illusion
- 23:12Blind Spot in Reviews
- 24:02Monkey Business Illusion
- 25:53Psychology and Coding
- 27:28Conclusion








