Sponsored
Enjoy fast, free delivery, exclusive deals, and award-winning movies & TV shows.
Buy New
-72% $18.45
FREE delivery Monday, May 11 on orders shipped by Amazon over $35
Ships from: Amazon
Sold by: waterfall media
$18.45 with 72 percent savings
List Price: $64.99 Image
Get Fast, Free Shipping with Amazon Prime
FREE delivery Monday, May 11 on orders shipped by Amazon over $35
Or Prime members get FREE delivery Thursday, May 7. Join Prime
Only 1 left in stock - order soon.
$$18.45 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$18.45
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Ships from
Amazon
Amazon
Ships from
Amazon
Returns
FREE 30-day refund/replacement
FREE 30-day refund/replacement
Quick refund
Usually issued within 24 hours. See exceptions
FREE return
At least one free return option available.
Convenient dropoff
At any of our 50,000 US locations.
See return policy
Gift options
Available at checkout
Available at checkout This item is a gift. Change
At checkout, you can add a custom message, a gift receipt for easy returns and have the item gift-wrapped
Payment
Secure transaction
Your transaction is secure
We work hard to protect your security and privacy. Our payment security system encrypts your information during transmission. We don’t share your credit card details with third-party sellers, and we don’t sell your information to others. Learn more
$1.54
$3.99 delivery May 11 - 13. Details
Or fastest delivery May 8 - 12. Details
Only 5 left in stock - order soon.
$$18.45 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$18.45
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Access codes and supplements are not guaranteed with used items.
Ships from and sold by Seattlegoodwill.
Added to

Sorry, there was a problem.

There was an error retrieving your Wish Lists. Please try again.

Sorry, there was a problem.

List unavailable.
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

  • Refactoring: Improving the Design of Existing Code (Addison-wesley Object Technology Series)

Follow the authors

Get new release updates & improved recommendations
See all
Something went wrong. Please try your request again later.

Refactoring: Improving the Design of Existing Code (Addison-wesley Object Technology Series) Edition Unstated

4.6 out of 5 stars (556)

{"desktop_buybox_group_1":[{"displayPrice":"$18.45","priceAmount":18.45,"currencySymbol":"$","integerValue":"18","decimalSeparator":".","fractionalValue":"45","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"u218%2BKZjmwSmOGau119xy10UkuhS6%2BUyGF8fTXAaQ20218m%2FxiBfnH16uiT6n%2BuSHSX7gOHDVGdEcuBs1EFafEsR0jnBgNTkUoa9fEThXDBm1v6qCKGSnSkdr8Sj6BwWCr1vQDzmXDQecJFAVCATPBe1Wp%2FD94Ak5MjwYZl9NcK5SZtCuzKHmOpQqIq81sip","locale":"en-US","buyingOptionType":"NEW","aapiBuyingOptionIndex":0}, {"displayPrice":"$1.54","priceAmount":1.54,"currencySymbol":"$","integerValue":"1","decimalSeparator":".","fractionalValue":"54","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"u218%2BKZjmwSmOGau119xy10UkuhS6%2BUyh7p9BOxM6J%2BYLXvh0MJPnF49DhfgrEMuWMnpYcsZZ2ezQG8J91w8we%2FIbdKDYCiB2n1JHVIGc4Qr36bsEfv4Gn9Nld3g%2FUuVNKFV%2BQiFmGNhVUEglIfMYUXN1VgL5M6Dzdm%2Ftke%2FGtGYBXitJZpuylAFaJkwGIdO","locale":"en-US","buyingOptionType":"USED","aapiBuyingOptionIndex":1}]}

Purchase options and add-ons

Refactoring is about improving the design of existing code. It is the process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its internal structure. With refactoring you can even take a bad design and rework it into a good one. This book offers a thorough discussion of the principles of refactoring, including where to spot opportunities for refactoring, and how to set up the required tests. There is also a catalog of more than 40 proven refactorings with details as to when and why to use the refactoring, step by step instructions for implementing it, and an example illustrating how it works The book is written using Java as its principle language, but the ideas are applicable to any OO language.

Sponsored

Frequently bought together

This item: Refactoring: Improving the Design of Existing Code (Addison-wesley Object Technology Series)
$18.45
Get it as soon as Monday, May 11
Only 1 left in stock - order soon.
Sold by waterfall media and ships from Amazon Fulfillment.
+
$33.61
Get it as soon as Sunday, May 10
In Stock
Ships from and sold by Amazon.com.
+
$26.49
Get it as soon as Sunday, May 10
In Stock
Ships from and sold by Amazon.com.
Total price: $00
To see our price, add these items to your cart.
Details
Added to Cart
Some of these items ship sooner than the others.
Choose items to buy together.

Customers also bought or read

Loading...

Editorial Reviews

Amazon.com Review

Your class library works, but could it be better? Refactoring: Improving the Design of Existing Code shows how refactoring can make object-oriented code simpler and easier to maintain. Today refactoring requires considerable design know-how, but once tools become available, all programmers should be able to improve their code using refactoring techniques.

Besides an introduction to refactoring, this handbook provides a catalog of dozens of tips for improving code. The best thing about Refactoring is its remarkably clear presentation, along with excellent nuts-and-bolts advice, from object expert Martin Fowler. The author is also an authority on software patterns and UML, and this experience helps make this a better book, one that should be immediately accessible to any intermediate or advanced object-oriented developer. (Just like patterns, each refactoring tip is presented with a simple name, a "motivation," and examples using Java and UML.)

Early chapters stress the importance of testing in successful refactoring. (When you improve code, you have to test to verify that it still works.) After the discussion on how to detect the "smell" of bad code, readers get to the heart of the book, its catalog of over 70 "refactorings"--tips for better and simpler class design. Each tip is illustrated with "before" and "after" code, along with an explanation. Later chapters provide a quick look at refactoring research.

Like software patterns, refactoring may be an idea whose time has come. This groundbreaking title will surely help bring refactoring to the programming mainstream. With its clear advice on a hot new topic, Refactoring is sure to be essential reading for anyone who writes or maintains object-oriented software. --Richard Dragan

Topics Covered: Refactoring, improving software code, redesign, design tips, patterns, unit testing, refactoring research, and tools.

From the Inside Flap

Once upon a time, a consultant made a visit to a development project. The consultant looked at some of the code that had been written; there was a class hierarchy at the center of the system. As he wandered through the hierarchy, the consultant saw that it was rather messy. The higher-level classes made certain assumptions about how the classes would work, assumptions that were embodied in inherited code. That code didn't suit all the subclasses, however, and was overridden quite heavily. If the superclass had been modified a little, then much less overriding would have been necessary. In other places some of the intention of the superclass had not been properly understood, and behavior present in the superclass was duplicated. In yet other places several subclasses did the same thing with code that could clearly be moved up the hierarchy.

The consultant recommended to the project management that the code be looked at and cleaned up, but the project management didn't seem enthusiastic. The code seemed to work and there were considerable schedule pressures. The managers said they would get around to it at some later point.

The consultant had also shown the programmers who had worked on the hierarchy what was going on. The programmers were keen and saw the problem. They knew that it wasn't really their fault; sometimes a new pair of eyes are needed to spot the problem. So the programmers spent a day or two cleaning up the hierarchy. When they were finished, the programmers had removed half the code in the hierarchy without reducing its functionality. They were pleased with the result and found that it became quicker and easier both to add new classes to the hierarchy and to use the classes in the rest of the system.

The project management was not pleased. Schedules were tight and there was a lot of work to do. These two programmers had spent two days doing work that had done nothing to add the many features the system had to deliver in a few months time. The old code had worked just fine. So the design was a bit more "pure" a bit more "clean." The project had to ship code that worked, not code that would please an academic. The consultant suggested that this cleaning up be done on other central parts of the system. Such an activity might halt the project for a week or two. All this activity was devoted to making the code look better, not to making it do anything that it didn't already do.

How do you feel about this story? Do you think the consultant was right to suggest further clean up? Or do you follow that old engineering adage, "if it works, don't fix it"?

I must admit to some bias here. I was that consultant. Six months later the project failed, in large part because the code was too complex to debug or to tune to acceptable performance.

The consultant Kent Beck was brought in to restart the project, an exercise that involved rewriting almost the whole system from scratch. He did several things differently, but one of the most important was to insist on continuous cleaning up of the code using refactoring. The success of this project, and role refactoring played in this success, is what inspired me to write this book, so that I could pass on the knowledge that Kent and others have learned in using refactoring to improve the quality of software. What Is Refactoring?

Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure. It is a disciplined way to clean up code that minimizes the chances of introducing bugs. In essence when you refactor you are improving the design of the code after it has been written.

"Improving the design after it has been written." That's an odd turn of phrase. In our current understanding of software development we believe that we design and then we code. A good design comes first, and the coding comes second. Over time the code will be modified, and the integrity of the system, its structure according to that design, gradually fades. The code slowly sinks from engineering to hacking.

Refactoring is the opposite of this practice. With refactoring you can take a bad design, chaos even, and rework it into well-designed code. Each step is simple, even simplistic. You move a field from one class to another, pull some code out of a method to make into its own method, and push some code up or down a hierarchy. Yet the cumulative effect of these small changes can radically improve the design. It is the exact reverse of the normal notion of software decay.

With refactoring you find the balance of work changes. You find that design, rather than occurring all up front, occurs continuously during development. You learn from building the system how to improve the design. The resulting interaction leads to a program with a design that stays good as development continues. What's in This Book?

This book is a guide to refactoring; it is written for a professional programmer. My aim is to show you how to do refactoring in a controlled and efficient manner. You will learn to refactor in such a way that you don't introduce bugs into the code but instead methodically improve the structure.

It's traditional to start books with an introduction. Although I agree with that principle, I don't find it easy to introduce refactoring with a generalized discussion or definitions. So I start with an example. Chapter 1 takes a small program with some common design flaws and refactors it into a more acceptable object-oriented program. Along the way we see both the process of refactoring and the application of several useful refactorings. This is the key chapter to read if you want to understand what refactoring really is about.

In Chapter 2 I cover more of the general principles of refactoring, some definitions, and the reasons for doing refactoring. I outline some of the problems with refactoring. In Chapter 3 Kent Beck helps me describe how to find bad smells in code and how to clean them up with refactorings. Testing plays a very important role in refactoring, so Chapter 4 describes how to build tests into code with a simple open-source Java testing framework.

The heart of the book, the catalog of refactorings, stretches from Chapter 5 through Chapter 12. This is by no means a comprehensive catalog. It is the beginning of such a catalog. It includes the refactorings that I have written down so far in my work in this field. When I want to do something, such as Replace Conditional with Polymorphism (255), the catalog reminds me how to do it in a safe, step-by-step manner. I hope this is the section of the book you'll come back to often.

In this book I describe the fruit of a lot of research done by others. The last chapters are guest chapters by some of these people. Chapter 13 is by Bill Opdyke, who describes the issues he has come across in adopting refactoring in commercial development. Chapter 14 is by Don Roberts and John Brant, who describe the true future of refactoring, automated tools. I've left the final word, Chapter 15, to the master of the art, Kent Beck. Refactoring in Java

For all of this book I use examples in Java. Refactoring can, of course, be done with other languages, and I hope this book will be useful to those working with other languages. However, I felt it would be best to focus this book on Java because it is the language I know best. I have added occasional notes for refactoring in other languages, but I hope other people will build on this foundation with books aimed at specific languages.

To help communicate the ideas best, I have not used particularly complex areas of the Java language. So I've shied away from using inner classes, reflection, threads, and many other of Java's more powerful features. This is because I want to focus on the core refactorings as clearly as I can.

I should emphasize that these refactorings are not done with concurrent or distributed programming in mind. Those topics introduce additional concerns that are beyond the scope of this book. Who Should Read This Book?

This book is aimed at a professional programmer, someone who writes software for a living. The examples and discussion include a lot of code to read and understand. The examples are all in Java. I chose Java because it is an increasingly well-known language that can be easily understood by anyone with a background in C. It is also an object-oriented language, and object-oriented mechanisms are a great help in refactoring.

Although it is focused on the code, refactoring has a large impact on the design of system. It is vital for senior designers and architects to understand the principles of refactoring and to use them in their projects. Refactoring is best introduced by a respected and experienced developer. Such a developer can best understand the principles behind refactoring and adapt those principles to the specific workplace. This is particularly true when you are using a language other than Java, because you have to adapt the examples I've given to other languages.

Here's how to get the most from this book without reading all of it.

If you want to understand what refactoring is, read Chapter 1; the example should make the process clear. If you want to understand why you should refactor, read the first two chapters. They will tell you what refactoring is and why you should do it. If you want to find where you should refactor, read Chapter 3. It tells you the signs that suggest the need for refactoring. If you want to actually do refactoring, read the first four chapters completely. Then skip-read the catalog. Read enough of the catalog to know roughly what is in there. You don't have to understand all the details. When you actually need to carry out a refactoring, read the refactoring in detail and use it to help you. The catalog is a reference section, so you probably won't want to read it in one go. You should also read the guest chapters, especially Chapter 15.

Building on the Foundations Laid by Others

I need to say right now, at the beginning, that I owe a big debt with this book, a debt to those whose work over the last decade has developed the field of refactoring. Ideally one of them should have written this book, but I ended up being the one with the time and energy.

Two of the leading proponents of refactoring are Ward Cunningham and Kent Beck. They used it as a central part of their development process in the early days and have adapted their development processes to take advantage of it. In particular it was my collaboration with Kent that really showed me the importance of refactoring, an inspiration that led directly to this book.

Ralph Johnson leads a group at the University of Illinois at Urbana-Champaign that is notable for its practical contributions to object technology. Ralph has long been a champion of refactoring, and several of his students have worked on the topic. Bill Opdyke developed the first detailed written work on refactoring in his doctoral thesis. John Brant and Don Roberts have gone beyond writing words into writing a tool, the Refactoring Browser, for refactoring Smalltalk programs.

Acknowledgments

Even with all that research to draw on, I still needed a lot of help to write this book. First and foremost, Kent Beck was a huge help. The first seeds were planted in a bar in Detroit when Kent told me about a paper he was writing for the Smalltalk Report Beck, hanoi. It not only provided many ideas for me to steal for Chapter 1 but also started me off in taking notes of refactorings. Kent helped in other places too. He came up with the idea of code smells, encouraged me at various sticky points, and generally worked with me to make this book work. I can't help thinking he could have written this book much better himself, but I had the time and can only hope I did the subject justice.

As I've written this, I wanted to share much of this expertise directly with you, so I'm very grateful that many of these people have spent some time adding some material to this book. Kent Beck, John Brant, William Opdyke, and Don Roberts have all written or co-written chapters. In addition, Rich Garzaniti and Ron Jeffries have added useful sidebars.

Any author will tell you that technical reviewers do a great deal to help in a book like this. As usual, Carter Shanklin and his team at Addison-Wesley put together a great panel of hard-nosed reviewers. These were

Ken Auer, Rolemodel Software, Inc. Joshua Bloch, Javasoft John Brant, University of Illinois at Urbana-Champaign Scott Corley, High Voltage Software, Inc. Ward Cunningham, Cunningham & Cunningham, Inc. Stephane Ducasse Erich Gamma, Object Technology International, Inc. Ron Jeffries Ralph Johnson, University of Illinois Joshua Kerievsky, Industrial Logic, Inc. Doug Lea, SUNY Oswego Sander Tichelaar

They all added a great deal to the readability and accuracy of this book, and removed at least some of the errors that can lurk in any manuscript. I'd like to highlight a couple of very visible suggestions that made a difference to the look of the book. Ward and Ron got me to do Chapter 1 in the side-by-side style. Joshua suggested the idea of the code sketches in the catalog.

In addition to the official review panel there were many unofficial reviewers. These people looked at the manuscript or the work in progress on my Web pages and made helpful comments. They include Leif Bennett, Michael Feathers, Michael Finney, Neil Galarneau, Hisham Ghazouli, Tony Gould, John Isner, Brian Marick, Ralf Reissing, John Salt, Mark Swanson, Dave Thomas, and Don Wells. I'm sure there are others who I've forgotton; I apologize and offer my thanks.

A particularly entertaining review group is the infamous reading group at the University of Illinois at Urbana-Champaign. Because this book reflects so much of their work, I'm particularly grateful for their efforts captured in real audio. This group includes Fredrico "Fred" Balaguer, John Brant, Ian Chai, Brian Foote, Alejandra Garrido, Zhijiang "John" Han, Peter Hatch, Ralph Johnson, Songyu "Raymond" Lu, Dragos-Anton Manolescu, Hiroaki Nakamura, James Overturf, Don Roberts, Chieko Shirai, Les Tyrell, and Joe Yoder.

Any good idea needs to be tested in a serious production system. I saw refactoring have a huge effect on the Chrysler Comprehensive Compensation system (C3). I want to thank all the members of that team: Ann Anderson, Ed Anderi, Ralph Beattie, Kent Beck, David Bryant, Bob Coe, Marie DeArment, Margaret Fronczak, Rich Garzaniti, Dennis Gore, Brian Hacker, Chet Hendrickson, Ron Jeffries, Doug Joppie, David Kim, Paul Kowalsky, Debbie Mueller, Tom Murasky, Richard Nutter, Adrian Pantea, Matt Saigeon, Don Thomas, and Don Wells. Working with them cemented the principles and benefits of refactoring into me on a firsthand basis. Watching their progress as they use refactoring heavily helps me see what refactoring can do when applied to a large project over many years.

Again I had the help of J. Carter Shanklin at Addison-Wesley and his team: Krysia Bebick, Susan Cestone, Chuck Dutton, Kristin Erickson, John Fuller, Christopher Guzikowski, Simone Payment, and Genevieve Rajewski. Working with a good publisher is a pleasure; they provided a lot of support and help.

Talking of support, the biggest sufferer from a book is always the closest to the author, in this case my (now) wife Cindy. Thanks for loving me even when I was hidden in the study. As much time as I put into this book, I never stopped being distracted by thinking of you.

Product details

  • Publisher ‏ : ‎ Addison-Wesley Professional
  • Publication date ‏ : ‎ January 1, 1999
  • Edition ‏ : ‎ Edition Unstated
  • Language ‏ : ‎ English
  • Print length ‏ : ‎ 431 pages
  • ISBN-10 ‏ : ‎ 0201485672
  • ISBN-13 ‏ : ‎ 978-0201485677
  • Item Weight ‏ : ‎ 2.51 pounds
  • Dimensions ‏ : ‎ 1 x 7.5 x 9.25 inches
  • Part of series ‏ : ‎ Addison-Wesley Object Technology
  • Best Sellers Rank: #197,763 in Books (See Top 100 in Books)
  • Customer Reviews:
    4.6 out of 5 stars (556)

About the authors

Follow authors to get new release updates, plus improved recommendations.
Sponsored

Customer reviews

4.6 out of 5 stars
556 global ratings
Sponsored

Customers say

Customers find this book to be a classic that every software developer must read, with excellent content and practical advice on refactoring. They appreciate how the refactoring process is performed in small steps, and one customer notes that each refactoring is accompanied by clear examples. The writing is well-structured and easy-to-understand, with one customer highlighting how it helps remember and organize these techniques in their mind. While customers find the book readable and well-written, opinions about its timelessness are mixed, with some noting that it dates poorly.
AI Generated from the text of customer reviews

Select to learn more

60 customers mention content, 59 positive, 1 negative
Customers find the book to be a classic that every software developer must read, with excellent content that is particularly useful for experienced developers.
older, but great book and technique for any professional developer. Tools may have change but technique still applies.Read more
A very good book and a must have for every professional programmer with a bunch of good stuff inside .Read more
Great resource to help me get from where my code is to where it should be....Read more
...Instead, I have been pleasantly surprised on how entertaining - along with being informative, educative and thorough - this book is....Read more
26 customers mention code quality, 24 positive, 2 negative
Customers appreciate the book's approach to code quality, helping them understand what constitutes good programming practices and how to improve existing code, with one customer noting how it enables code evolution.
Refactoring: Improving the Design of Existing Code is one of those amazing books that every professional developer should have on their book shelf....Read more
This is a great read to improve legacy code and to follow for new projects. It is for work related use not recreational reading.Read more
Excellent resource for improving legacy code.Read more
...a place on my bookshelf with Design Patterns by the Gang of Four, Clean Code and the Pragmatic Programmer.Read more
20 customers mention refactoring, 20 positive, 0 negative
Customers appreciate the book's approach to refactoring, noting that each transformation is performed in small steps and includes clear examples.
Good book on refactoring patterns. I feel that some of these issues are very Java specific, but there is still a lot of good info within.Read more
Excellent resource for improving legacy code.Read more
Simple steps and good explanations about refactoring. Usefull examples help you to understand texhnique and whole the way of refactoring. Must reed!...Read more
The book is absolutely perfect. Not only does it explain in detail the art of refactoring, it also does so in a way that anyone can understand...Read more
15 customers mention simplicity, 13 positive, 2 negative
Customers appreciate the book's simplicity, as it provides easy-to-understand pieces, outlines steps to take, and includes simple examples.
...this book clearly and concisely presents each concept with simple examples, UML diagrams, and good explanations of the pros and cons of performing...Read more
...The examples are clear, well thought out and relevant....Read more
This book helps me to understand and know how to make a good code change after debugging a bug - functionality or performance.Read more
...I will be able to break complicated code down to small and easy-to-understand pieces.Read more
9 customers mention organization, 9 positive, 0 negative
Customers appreciate the book's organization, with one customer noting its well-structured content and another mentioning how it helps with remembering and organizing techniques in their mind.
The book is very well structured, with an excelent introduction about the theme followed by a catalog of refactorings....Read more
...The examples are clear, well thought out and relevant....Read more
Great book with very clear writing style, no fluff. Excellent structure and examples. This is classic.Read more
helped me improving the design, it's the best refactoring book I have ever read..gives u vague idea about improving the codeRead more
9 customers mention writing style, 8 positive, 1 negative
Customers appreciate the writing style of the book, finding it well-crafted, with one customer noting its humorous tone and another mentioning how it changed their coding approach.
...The book is well written and super!Read more
...I am happy that such a writing style makes it hard for me to put the book down and to continue reading!Read more
...Martin Fowler books are always a joy to read. His writing style is humorous, yet often very blunt and to the point....Read more
A fundamental book on different types of refactoring, clearly written....Read more
9 customers mention timeless, 5 positive, 4 negative
Customers have mixed opinions about the book's timelessness, with some considering it a classic that every computer science major should read, while others note that it dates poorly.
This is a classic that every computer science major, or any hard working software engineer should read....Read more
Sometimes, classics date poorly. Like, say, "The Watchmen" by Moore, or "Monty Python", or the quill....Read more
Classic textbook.Read more
This book is a bit old. It is the first, or among the first, which addresses the refactoring issue....Read more
6 customers mention readability, 4 positive, 2 negative
Customers have mixed opinions about the book's readability.
...The material in this book is crucial to building efficient, clean, readable, testable code....Read more
...I am giving 4 star only because on kindle version of the book code is not readable. Please please fix the code issue and update the kindle book....Read more
...Easy to read and well organized, this book is a must-have to hone the craft of creating good code.Read more
...you adopt each and every one of the recommended practices, this book clearly and concisely presents each concept with simple examples, UML diagrams,...Read more

Top reviews from the United States

  • Reviewed in the United States on February 16, 2007
    Format: HardcoverVerified Purchase
    Refactoring: Improving the Design of Existing Code is one of those amazing books that every professional developer should have on their book shelf. The bulk of this book is a catalog of refactorings, but there is more to it as I will explain below.

    In case you aren't aware of what refactoring is, I'll give you Fowlers definition.

    "Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure." For the most part this means cleaning up your existing - yet working - code. It involves anything from renaming a method to be more concise with the purpose of that method, to breaking up switch statements into a polymorphic structure. There are many different techniques used to refactor your code, which is what you learn in this book.

    Right off the bat Fowler throws you into a small sample application that is poorly designed. He then takes you through a few different refactoring techniques that improve the design of this simple application. Right from the start you see how effective refactoring can be. From there he goes into topics such as how to detect "bad smells" in code. This chapter is particularly informative and entertaining. You also learn a little bit about testing. After the introductory chapters you begin to dig into a deep catalog of refactorings. Each one is named. Like design patterns - naming the refactoring and building a vocabulary really helps in communicating thoughts and ideas.

    The catalog of refactorings is extremely useful. They are structured so that each refactoring has a name, a motivation, the mechanics and a simple example. This is very effective. As I said earlier, the name is useful because it helps build your programming vocabulary and it helps in communicating thoughts and ideas. The motivation explains why the refactoring should be done and when it should/shouldn't be used. The mechanics provide a step-by-step description of how to carry out the refactoring and the example shows a small example of the refactoring in use. All examples are written in Java 1.1.

    Although the examples are written in Java the book is still very good for any developer. Developers that have never written a line of code in Java, C++, C#, or anything similar may have a little bit of a tougher time working through this book. Luckily most examples are very small and simple so even if you fall into this category you shouldn't have too much of a learning curve. Some of the code is a bit outdated and can be done a bit better now-a-days but what do you expect? This book was written 8+ years ago! Times have changed. The ideas are still very relevant though, which is what makes this book so timeless.

    Martin Fowler books are always a joy to read. His writing style is humorous, yet often very blunt and to the point. Just like UML Distilled, he is able to communicate a lot of ideas into a very short amount of space - the book is a bit dense in other words, which is very good in my opinion. Martin Fowler does not beat around the bush and he has very strong opinions on certain topics. Unlike a lot of books you read, he actually writes with personality. I have a hard time putting his books down. Here is an example of the type of verbiage he uses...

    On how comments can be a "bad smell":

    "Don't worry; we aren't saying that people shouldn't write comments. In our olfactory analogy, comments aren't a bad smell; indeed they are a sweet smell. The reason we mention comments here is that comments often are used as a deodorant." - Martin Fowler. Here he is talking about how people use comments to hide bad code, or "bad smells".

    I highly recommend this book. If you are a professional developer or plan on becoming one then click the "Buy Now" button without second thought. This is one of those rare books worth its weight in gold - I would spend $100.00 on a book like this if I had to.
    15 people found this helpful
    Report
  • Reviewed in the United States on March 14, 2013
    Format: HardcoverVerified Purchase
    This book is replete with advanced knowledge of the situational logic of refactoring code in procedural and object oriented languages ... The point of view is that of a software engineer inclined to perfectionism ... Many typical kinds of bad code from a module or a function or a method or a class are outlined in Chapter 3 item by item 22 different situations are described and critiqued ... Much of the remainder of the book outlines what remedies the principal author and the other authors suggest as to how to refactor the code to meet this book's standards ...

    One doubt immediately comes to mind: what about the economics in industry of refactoring? Whilst I agree, say, that a car self parking system needs to be well nigh perfect in that this is the only way to assure safety for car drivers and nearby pedestrians, many an employer will say no just say no to refactoring exercises for perfection's sake! For example, many financial systems have the odd unimportant user interface bug that there's simply not the funds to get fixed.

    And every source code change involves risks: the risk that bugs are introduced; the risk that the unit and system testing will be inadequate; the risk of feature drift, the application semantics being misunderstood; and, the risk of loss of source code though related hardware failure. Source code control systems and people employed as change managers need to question whether the risk of some minor change should be countenanced, or rejected if too risky!

    It is possible that too many refactoring exercises might take a large system that works well and lead to it degenerating into an unholy mess, with added introduced bugs, the destruction of the original architect's vision, and changes that erode the system's integrity and purpose. This is a management problem. Quality code is not free. If a large system really needs extentive refactoring the real question is as to whether over the expected lifetime of the code it would be cheaper to refactor, or to throw the system away and start from scratch!

    It is overall more advisable to get the system right in the first place. A better design with a better architecture if put together for a hypothetical version 1 of a large system will reduce maintenance cost down the track ...

    Nevertheless an excellent book of practical advice on refactoring and code quality!

    An advanced reference work for third year university software engineering students, practising software engineers, and software engineering managers. Managers whose background is other than a career in programming would particularly benefit from this work.
    6 people found this helpful
    Report
  • Reviewed in the United States on December 12, 2013
    Format: HardcoverVerified Purchase
    This book is a bit old. It is the first, or among the first, which addresses the refactoring issue. However, everything in it is relevant today.

    At the beginning and at the end you will find articles by various authors (Fowler, Beck, Opdyke, Roberts and Brant):

    * Refactoring , first example.
    * Principles of refactoring .
    * Bad smells in code .
    * Building Tests.
    * Toward a Catalog of Refactorings .
    * Big Refactorings .
    * Refactoring , Reuse , and Reality .
    * Refactoring Tools.
    * Putting It All Together.

    In the middle will find a great catalog of small transformations that define the steps to do the refactoring. This catalog, though simple is very important as explained in the first chapters.

    Fowler clearly explains why refactoring, some clues to identify the most important issues (code smells) to refactor in order to improves the design, and the catalog of transformations that are commonly used to solve each code smells.

    Dependending your experience and knowledge of software craftsmanship, you will surely perceive it more or less as a simple topic, but that makes it no less important.

    It is a fantastic book. It is one of the books that every software developer in the industry should read. The only reason I'm not giving 5 stars is that it is not a truly revealing book. The items inside are all very basic and simple. You should not expect anything astonishing and the first impression is that all of it is obvious, but it is explained in an exceptional way and the catalog created by Fowler is really great.
    11 people found this helpful
    Report

Top reviews from other countries

Translate all reviews to English
  • Lia Ghita
    5.0 out of 5 stars Good quality. Extremely fast delivery
    Reviewed in Germany on November 25, 2021
    Format: HardcoverVerified Purchase
    The book is in very good condition. The delivery was extremely fast and via courier.
  • Amazon Customer
    3.0 out of 5 stars a must read for any software developer
    Reviewed in Japan on April 8, 2014
    A great book about refactoring, an absolute classic.

    However, I must remove two stars because my kindle paperwhite freezed at least 10 times while reading this book. Also, why the code sample is not available for download on the author's page?!
  • Daniel
    5.0 out of 5 stars Una lectura obligatoria
    Reviewed in Mexico on November 22, 2016
    Format: HardcoverVerified Purchase
    Definitivamente muchos otros libros se inspiran en este libro para hablar de la refactorización. Sin mencionar que de este libro nació uno de los principios de los principios SOLID.
    Report
  • Bruno Santos de Lima
    5.0 out of 5 stars Muito bom!
    Reviewed in Brazil on September 4, 2018
    Format: HardcoverVerified Purchase
    Livro muito bom, indico para qualquer desenvolvedor ou pesquisador que trabalhe com refatoração.
  • Albertazzi Angelo
    5.0 out of 5 stars Ottimo
    Reviewed in Italy on February 25, 2018
    Format: HardcoverVerified Purchase
    Il libro è un insieme di "buone" regole di programmazione e tecniche di refactoring per rendere il codice più manutenibile.
    Assieme a Clean Code e The Pragmatic Programmer è uno dei miei testi di riferimento per quanto riguarda i principi di "buona" programmazione!