👨‍💻
Software Engineering
Tidy First?: A Personal Exercise in Empirical Software Design
Tidy First?: A Personal Exercise in Empirical Software Design
  • Tidy First?
  • Foreword
  • Preface
  • Part 1: Tidyings
    • 1: Guard Clauses
    • 2: Dead Code
    • 3: Normalize Symmetries
    • 4: New Interface, Old Implementation
    • 5: Reading Order
    • 6: Cohesion Order
    • 7: Move Declaration & Initialization Together
    • 8: Explaining Variables
    • 9: Explaining Constants
    • 10: Explicit Parameters
    • 11: Chunk Statements
    • 12: Extract Helper
    • 13: One Pile
    • 14: Explaining Comments
    • 15: Delete Redundant Comments
  • Part 2: Managing
    • Coming soon
  • Part 3: Theory
    • Coming soon
Powered by GitBook
On this page
  • Delete it
  • Deleting dead code can be strange
  • What if we need it later?
  1. Part 1: Tidyings

2: Dead Code

Delete it

If the code doesn't get executed, just delete it.

Deleting dead code can be strange

  • Someone took the time & effort to write it.

  • The organization paid for it.

  • All somebody needs to do to make it valuable is to call it again.

  • If we need it, we'll be sad we deleted it.

How many cognitive biases are in the reasons above?

What if we need it later?

We have Version Control. If worse comes to worst, we can always get it back.

Or, we can just write it again, but better. What's the likelihood we will use it again in exactly the same way it was originally written?

Previous1: Guard ClausesNext3: Normalize Symmetries

Last updated 23 days ago