

Buy anything from 5,000+ international stores. One checkout price. No surprise fees. Join 2M+ shoppers on Desertcart.
Desertcart purchases this item on your behalf and handles shipping, customs, and support to Peru.
"Whenever you read [ Refactoring ], it’s time to read it again. And if you haven’t read it yet, please do before writing another line of code." –David Heinemeier Hansson, Creator of Ruby on Rails, Founder & CTO at Basecamp Fully Revised and Updated—Includes New Refactoring's 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 refactoring's 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.) Review: Great book. - Wonderful book on refactoring. Review: Absolute must have book for every developer’s library! - Fantastic book and one that should be in every developers personal library. The depth of knowledge and technical precision the author has in regards to refactoring is immense. This book is not a quick read but should be read in its entirety to really take in all that refactoring has to offer. Refactoring has now become part of my everyday programming and development process. There is only one thing I would change about the book and that is for the author to add the completed refactored code for some of the more complex methodologies to the end of each refactoring. Some of the refactoring methodologies can be quite extensive and by adding the completed refactored code to the end may help give a clearer picture of the information the author is imparting to the reader. Other than that this book has taught me so much about refactoring and will be a go to book for the rest of my software development career.

| Best Sellers Rank | #59,241 in Books ( See Top 100 in Books ) #8 in Object-Oriented Design #11 in Software Testing #35 in Software Development (Books) |
| Customer Reviews | 4.7 out of 5 stars 1,212 Reviews |
R**Y
Great book.
Wonderful book on refactoring.
J**E
Absolute must have book for every developer’s library!
Fantastic book and one that should be in every developers personal library. The depth of knowledge and technical precision the author has in regards to refactoring is immense. This book is not a quick read but should be read in its entirety to really take in all that refactoring has to offer. Refactoring has now become part of my everyday programming and development process. There is only one thing I would change about the book and that is for the author to add the completed refactored code for some of the more complex methodologies to the end of each refactoring. Some of the refactoring methodologies can be quite extensive and by adding the completed refactored code to the end may help give a clearer picture of the information the author is imparting to the reader. Other than that this book has taught me so much about refactoring and will be a go to book for the rest of my software development career.
V**A
Very useful even for experienced programmers and well designed
This is a great book! I'm a Java dev with 6yoe and I still learn from this book. There are some things I knew, some I forgotten or thought about but didn't know a proper name of and some I have never thought of. The language used is Javascript but it's syntax shouldn't be hard to follow. Also, the book quality is high and there are lots of pretty diagrams if it matters for you (it certainly does for me).
N**A
If you have the right 'why', you can bear almost any 'how'
Code is written by humans, executed by machines. Live code is also read by (other) humans for about 10x more than the time it took to write it. This is where "refactoring" comes to play. It is sort of making continuous improvement to code so it is more readable. It is cleaning up cobwebs from the corners. One of the most popular CS papers ever ("Hints for Computer System Design", 1983) suggests 3-step process about writing code - first, make it work; second, make it right; finally, make it fast". This book, a succinct second edition of a very popular first, is an excellent "show and tell" for the second part. It has a catalog of "code smells" and an inventory of "refactoring tricks" mapped to each. The first edition had working Java examples. The present one shows JavaScript ones. The examples are real-life but simple enough to not distract from the core - how to simplify the "first version" of code. Apart from the content, the insights that pops out can only be gleaned from years of deep experience. One example, say, most developers encode a "phone number" attribute as string in the first attempt of modeling. Soon enough, one needs to add "spam rules", "blocking number", "area code" etc. That necessitates phone number to be 'refactored' from string (i.e., a primitive type) to its own object model (say, a class called PhoneNumber). The author cheekily refers to the former type of behavior as "stringly typed" variables. Word play is a hallmark of many good engineers I'd worked with, but it is also a phenomenal way to remember things. Humor shortens the retrieval curve. What I liked most about the book is a broad adoption of "Paracelsus' Maxim" - the difference between a poison and something benign is the dose. Most of the refactoring pattens come in pairs. You can "extract function" from a big one, or "inline function code" if it is short, obvious and singularly used, say. You can "replace parameter with query" or "replace query with a parameter". The only unpaired pattern shows up with large/complex conditionals (say, a switch, or a multiway nested conditional with 'guard clause) - most/all of them are pain to read and should ideally be refactored, say, with "replace conditional with polymorphism". Live book site has 4 more patterns beyond the book. I found the refactoring patterns could be of three principal dimensions - one, structure -- variable, method, class, conditional; two, usage and locality -- depending on how much they're used and if they are used within/outside the module (class); three, data and mutation -- there is a clear separation between refactoring a data (or, value) object/data passed as value- or reference; separating data (query) from command etc. On top of that, some of the refactoring could be thought of as "helping the original developer" (say, to modularize or DRY better) vs. "helping others who may read the code later". When I read the first edition years ago, IDEs were not as robust nor opinionated enough about refactoring. These days, majority if not all the refactoring is done by default - one just needs to click to accept, say, extracting a method. It has been a huge time saving and long-term benefit for collaborative work and fits very well within the philosophy of "continuous integration"/Kaizen etc. One could argue that lowers the importance of such book. While the IDE may do the grunt work, key decisioning remains with humans, for now. Especially since most refactoring could appear in polar opposites it is therefore even more important to understand the context - the "why" - which this book brilliantly lays out.
A**R
Refactoring Software
One of the best software developer books, If you have the challenge of redesign a software application this is the book you need to read but before buy it, make sure the application you are going to refactor has unit-tests, if not as the book mentioned first you need to read: Working Effectively with Legacy Code of Michael Feathers, read this book first and later read this one. Thank you so much to Martin Fowler.
T**S
New material - new refactorings
I've been impatiently waiting the second edition ever since I heard it was coming. If you're like me, looking for an excuse to re-read Refactoring, now is the time. Some of the new refactorings, like Split Phase, fill me with glee because there's finally a formal approach to something I've just been winging for several years now. It draws attention to the practice of splitting out computations from rendering/formatting, which is an unfamiliar topic for many developers but it's absolutely crucial for high-quality code. There's a strong mix of classic refactorings from the original book, too, updated and broadened to apply to any programming language. I am very happy with the code formatting on kindle, which has rarely been the case. Definitely worth the wait!
R**A
Every Software Engineer should read this book
Best book related to this topic, examples are easy to understand. Book arrived in perfect conditions to Bolivia.
G**R
great Book
This is a comprehensive review of refactoring.
R**L
Excelente libro
Muy buen libro, desde las primeras páginas me dio tips para realizar refactor en mis proyectos.
A**O
Muy útil
Me ha gustado el estilo, es muy ameno y práctico. Todo tiene su lógica y lo estoy aplicando en mi código y en las reviews que hago. Puede que cambie para siempre la forma en la que programo. No puedo dejar de leer y releer. Me ofrece ideas de cómo escribir, probar y revisar código y también propone una nomenclatura para cada tipo de refactor que es un estandar para discutir con otros desarrolladores.
A**ー
Well worth having
Be careful with the paper, as it’s quite thin. Overjoyed with the contents of the book though, it’s going to serve me well for many years I’m sure.
S**R
Interessant
Der Beschenkte war begeistert von dem Buch. Sehr informativ für ihn. Ist aber zu beachten, dass es auf Englisch verfasst wurde, da Original.
A**R
good read
quality is fantastic.
Trustpilot
1 month ago
3 weeks ago