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 Code: A Handbook of Agile Software Craftsmanship
Even bad code can function. But if code isn’t clean, it can bring a development organization …
book
Head First Design Patterns, 2nd Edition
What will you learn from this book? You know you don't want to reinvent the wheel, …
book
Head First Software Architecture
What will you learn from this book? If you're a software developer looking for a quick …
book
Clean Architecture: A Craftsman's Guide to Software Structure and Design
Building upon the success of best-sellers The Clean Coder and Clean Code, legendary software craftsman Robert …