Ouch! That Code Hurts My Brain
summary
Claim: refactor by keep each puzzle small and leave many clues so future readers reconstruct the big picture with far less effort. Concrete actions: rename confusing names (topics_in_category → topic_ids_in_category), extract three-line chunks into private methods (associate_displayable_topics_for_category), map IDs to objects and filter displayable topics earlier. Measured payoff: avoid the ~4–5 minutes of guessing per confusing chunk and make intent explicit so callers read what the code does, not how it does it.
AI-written summary · about
chapters (10)
- 0:00Introduction to code clarity
- 1:02The problem with complex code
- 2:14Cognitive load in development
- 4:04Why poor code is problematic
- 4:46Strategies for improvement
- 6:20Refactoring for readability
- 7:21Code example one: Chunk upload
- 9:28Code example two: Categories
- 13:21Advanced refactoring techniques
- 18:50Conclusion
related talks
12mImpactful Refactors: Refactoring for Readability
30mNaming is Hard!
20mPre-factoring: Getting it (Closer to) Right the First Time
25mRefactoring: The ASMR of Programming Talks
40mConscious Coding Practice: The Three Concrete Steps
29mLess abstract! Surprising effects of expressing rules of OOP...
36mUnfactoring From Patterns
35mHurting Code for Fun and Profit
