The Shape of a Program
summary
Argues that complexity is usefully measured by the area under the indentation and demonstrates concrete refactorings that reduce it: invert nested ifs into guard clauses and pull blocks (like a big switch) out via extract function. Shows a nested example where these steps shrink indentation dramatically — more than half in the demo — turning a deep, hard-to-follow function into a short, flat one that compiles and keeps original behavior.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:35Program Complexity
- 1:54Number of Program
- 2:04Complexity Metric
- 2:14Wikipedia
- 2:30Twitter
- 2:58Squarish
- 3:11Complex
- 3:57Guard clauses
- 4:25Extracting
- 4:44Conclusion
related talks
06mLess Code = More Software
21m“Fearless Refactoring & the Art of Argument-Free Rust”
06mLightning Talk: Whitespace: A Humorous Short Talk
15mC++ Puzzlers
31mFunctional programming guerilla in the land of Rust
35mAshley Williams - SeattleJS Conference 2017
01h 03mBringing Clean Code to large scale legacy Applications
01h 50mUnderstanding Compiler Optimization
