Book description
Fully Revised and Updated–Includes New Refactorings and Code Examples
- “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.”
—M. Fowler (1999)
For more than twenty years, experienced programmers worldwide have relied on Martin Fowler’s Refactoring to improve the design of existing code and to enhance software maintainability, as well as to make existing code easier to understand.
This eagerly awaited new edition has been fully updated to reflect crucial changes in the programming landscape. Refactoring, Second Edition, features an updated catalog of refactorings and includes JavaScript code examples, as well as new functional examples that demonstrate refactoring without classes.
Like the original, this edition explains what refactoring is; why you should refactor; how to recognize code that needs refactoring; and how to actually do it successfully, no matter what language you use.
- Understand the process and general principles of refactoring
- Quickly apply useful refactorings to make a program easier to comprehend and change
- Recognize “bad smells” in code that signal opportunities to refactor
- Explore the refactorings, each with explanations, motivation, mechanics, and simple examples
- Build solid tests for your refactorings
- Recognize tradeoffs and obstacles to refactoring
Includes free access to the canonical web edition, with even more refactoring resources. (See inside the book for details about how to access the web edition.)
Table of contents
- Cover Page
- About This E-Book
- Front End Paper
- Title Page
- Copyright Page
- Dedication Page
- Contents
- Foreword to the First Edition
- Preface
-
Chapter 1 Refactoring: A First Example
- The Starting Point
- Comments on the Starting Program
- The First Step in Refactoring
- Decomposing the statement Function
- Status: Lots of Nested Functions
- Splitting the Phases of Calculation and Formatting
- Status: Separated into Two Files (and Phases)
- Reorganizing the Calculations by Type
- Status: Creating the Data with the Polymorphic Calculator
- Final Thoughts
- Chapter 2 Principles in Refactoring
-
Chapter 3 Bad Smells in Code
- Mysterious Name
- Duplicated Code
- Long Function
- Long Parameter List
- Global Data
- Mutable Data
- Divergent Change
- Shotgun Surgery
- Feature Envy
- Data Clumps
- Primitive Obsession
- Repeated Switches
- Loops
- Lazy Element
- Speculative Generality
- Temporary Field
- Message Chains
- Middle Man
- Insider Trading
- Large Class
- Alternative Classes with Different Interfaces
- Data Class
- Refused Bequest
- Comments
- Chapter 4 Building Tests
- Chapter 5 Introducing the Catalog
- Chapter 6 A First Set of Refactorings
- Chapter 7 Encapsulation
- Chapter 8 Moving Features
- Chapter 9 Organizing Data
- Chapter 10 Simplifying Conditional Logic
- Chapter 11 Refactoring APIs
- Chapter 12 Dealing with Inheritance
- Bibliography
- Index
- Back End Paper
- Code Snippets
Product information
- Title: Refactoring: Improving the Design of Existing Code
- Author(s):
- Release date: November 2018
- Publisher(s): Addison-Wesley Professional
- ISBN: 9780134757681
You might also like
book
Refactoring: Improving the Design of Existing Code
As the application of object technology--particularly the Java programming language--has become commonplace, a new problem has …
book
Design Patterns: Elements of Reusable Object-Oriented Software
Capturing a wealth of experience about the design of object-oriented software, four top-notch designers present a …
book
Head First Design Patterns
What’s so special about design patterns? At any given moment, someone struggles with the same software …
book
Domain-Driven Design: Tackling Complexity in the Heart of Software
“Eric Evans has written a fantastic book on how you can make the design of your …