Book description
Messy code is a nuisance. "Tidying" code, to make it more readable, requires breaking it up into manageable sections. In this practical guide, author Kent Beck, creator of Extreme Programming and pioneer of software patterns, suggests when and where you might apply tidyings to improve your code while keeping the overall structure of the system in mind.
Instead of trying to master tidying all at once, this book lets you try out a few examples that make sense for your problem. If you have a big function containing many lines of code, you'll learn how to logically divide it into smaller chunks. Along the way, you'll learn the theory behind software design: coupling, cohesion, discounted cash flows, and optionality.
This book helps you:
- Understand the basic theory of how software design works and the forces that act on it
- Explore the difference between changes to a system's behavior and changes to its structure
- Improve your programming experience by sometimes tidying first and sometimes tidying after
- Learn how to make large changes in small, safe steps
- Approach software design as an exercise in human relationships
Publisher resources
Table of contents
- Foreword
- Preface
- Introduction
- I. Tidyings
- 1. Guard Clauses
- 2. Dead Code
- 3. Normalize Symmetries
- 4. New Interface, Old Implementation
- 5. Reading Order
- 6. Cohesion Order
- 7. Move Declaration and 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
- II. Managing
- 16. Separate Tidying
- 17. Chaining
- 18. Batch Sizes
- 19. Rhythm
- 20. Getting Untangled
- 21. First, After, Later, Never
- III. Theory
- 22. Beneficially Relating Elements
- 23. Structure and Behavior
- 24. Economics: Time Value and Optionality
- 25. A Dollar Today > A Dollar Tomorrow
- 26. Options
- 27. Options Versus Cash Flows
- 28. Reversible Structure Changes
- 29. Coupling
- 30. Constantine’s Equivalence
- 31. Coupling Versus Decoupling
- 32. Cohesion
- 33. Conclusion
- Appendix. Annotated Reading List and References
- Index
- About the Author
Product information
- Title: Tidy First?
- Author(s):
- Release date: October 2023
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781098151249
You might also like
book
Clean Agile: Back to Basics
Agile Values and Principles for a New Generation “In the journey to all things Agile, Uncle …
book
The Pragmatic Programmer: your journey to mastery, 20th Anniversary Edition, 2nd Edition
"One of the most significant books in my life." —Obie Fernandez, Author, The Rails Way "Twenty …
book
Learning Domain-Driven Design
Building software is harder than ever. As a developer, you not only have to chase ever-changing …
book
Building Micro-Frontends
What's the answer to today's increasingly complex web applications? Micro-frontends. Inspired by the microservices model, this …