👨‍💻
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
  1. Part 1: Tidyings

4: New Interface, Old Implementation

You need to call a routine but the interface makes it difficult/complicated/confusing/tedious.

Implement and use the interface you wish you could call. Implement the new interface by calling the old one.

A pass-through interface is the micro-scale essence of software design.

The same impulse holds true when you are:

  • Coding Backward: Start with the last line of a routine, as if you already had all the intermediate results you needed.

  • Coding Test-First: Start with the test you need to pass.

  • Designing Helpers: If only I had a routine/object/service that did XXX, then the rest of this would be easy.

Previous3: Normalize SymmetriesNext5: Reading Order

Last updated 22 days ago