🗑️

Lecture on Deleting Code

Jul 11, 2024

Lecture on Deleting Code

Introduction

  • Different topic: Deleting code
  • Few talks about deleting code
  • Personal experience: Spent morning on slides, changed mind, using only one slide
  • Question: Feel good removing more code than added in pull requests?

Waterfall and Its Irony

  • Waterfall paper irony: Describes agile
  • How many read it?
  • Importance: Read waterfall paper
  • Describes modern agile throughout except first page

The Big Ball of Mud

  • Inevitability and optimality
  • Concept: Smaller pockets inside big ball of mud
  • Aim: Writing code to delete it

Code Deletion and Optimization

  • Importance of deletable code
  • Erlang's influence: Small programs, often rewritten
  • Writing code to delete: Facilitates easier feature addition

Refactoring Misconceptions

  • Many misunderstanding refactoring
  • Refactor: Change either test or code, not both at once
  • Tools pushing incorrect practices

Influence of Tools on Code

  • Big IDEs influence on code structure
  • Example: Erlang promotes small programs and microservices

Microservices and Optimal Size

  • Definition of microservices unclear
  • Finding Goldilocks zone for microservices
  • Rule of thumb: Work not exceeding one week

Benefits of Deleting Code

  • Reduces fear, improves velocity, easier to manage
  • Technical debt and risk management
  • Focus on decoupling and deletable code

Practical Examples and Strategies

  • Example: Event Store, benefits of rewriting backend
  • Use of coupling analysis tools like Sonar and DepenD
  • Optimizing for deletability, managing risks, avoiding monoliths

Technical Debt

  • Not inherently bad; compared to financial debt
  • Managing technical debt with deletable code

Importance of Mastering Fundamentals

  • References to Alan Kay's object-oriented concepts
  • Importance of understanding core principles
  • Erlang and Unix principles aligned with modern practices

Practical Takeaways

  • Aim for small, manageable code modules
  • Optimizing code for deletability enhances flexibility and reduces fear
  • Refactoring as needed rather than forced by tools
  • Adopt practical, manageable approaches over complex abstractions

Conclusion

  • Deletion as an architectural quality
  • Encouragement to explore fundamental programming concepts and approaches