Hasty Briefsbeta

Skin-Shedding Code (2024)

5 days ago
  • #programming
  • #zed
  • #refactoring
  • Shredding refers to rewriting code by taking it apart and rebuilding it in a better way, akin to refactoring but more aggressive.
  • At Zed, shredding is a common practice where entire sections of code are deleted and rebuilt from scratch to fit new requirements.
  • The team at Zed rewrote their UI framework, GPUI, in a multi-week shred, resulting in a massive pull request.
  • Shredding requires confidence, experience, and self-awareness to know when it's appropriate to rebuild rather than make small changes.
  • The effectiveness of shredding at Zed may stem from high domain knowledge, excellent programmers, and careful, scoped teardowns.
  • Regular shreds help maintain a healthy codebase by removing accumulated inefficiencies and allowing for ideal redesigns.
  • Jonathan Blow refers to this approach as 'Sledgehammer programming,' emphasizing the importance of high domain knowledge.