How to Code Like a Writer
summary
Claim: the Elements of Style rules guide concrete refactors. The process refactors a 427‑line utilities class using tests, small extractions, and vocabulary from Ruby stdlib, replacing inline structs with a ShipmentList value object and simplifying APIs. Metrics move: 427 lines of code shrinks, duplication (flay) drops to zero, flog 180 → 77.2 and build_shipments flog 120.7 → 3. Tests pass throughout and the final code reads in clear, parallel “paragraphs” and actually changes behavior reliably.
AI-written summary · about
chapters (4)
- 0:00Start
- 8:23Strunk and White 2.19 Express coordinate ideas in similar form
- 12:41Strunk and White 2.17 Omit Needless Words
- 17:37Strunk and White 2.16 Use definite, specific, concrete language








