|
|||||||||||||||||||||||||||||||||||
|
146 Reviews
|
Average Customer Review
Share your thoughts with other customers
Create your own review
|
|
Most Helpful First | Newest First
|
|
144 of 150 people found the following review helpful:
4.0 out of 5 stars
Recipes for improving code,
By
This review is from: Refactoring: Improving the Design of Existing Code (Hardcover)
Like the Gang of Four's landmark book _Design Patterns_, Fowler and his cohorts have created another catalog-style book, this time on refactoring.Refactoring refers to taking existing, working software, and changing it about to improve its design, so that future modifications and enhancements are easier to add. _Refactoring_ is primarily a catalog of 70 or so different kinds of improvements you can make to object-oriented software. Each entry in the catalog describes an implementation problem, the solution, motivation for applying the solution, the mechanics of the refactoring, and examples. The book's examples are all in Java, but C++ programmers should be able to approach the refactorings with ease. Often, Fowler diagrams the refactorings in UML, so a little Unified Modeling Language experience will help, too. While the catalog is nice, the kinds of refactorings are obvious is most cases. Even moderately experienced programmers won't need the step-by-step mechanics described. The real benefit, though, is that the mechanics of each refactoring help guarantee that you can pull off the refactoring without introducing new bugs or side effects. They encourage you to take smaller, verifiable steps, than the more gross refactorings that most developers would naturally take. You actually save time doing so. How do you know your refactorings are safe? Unit testing is the answer that Fowler et al. provide. Java developers will find the introduction to the Junit Testing Framework the most valuable part of the book, more so than the catalog of refactorings itself. There's more to the book than the catalog and Junit, of course. There's discussion of the history of refactoring, how to evaluate refactoring tools, and how to convince management that what appears to be an overhead activity is actually useful in the long run. Unfortunately, these sections are all too brief. And there is no discussion of how refactoring fits in with various software development processes. For example, programmers using Extreme Programming (XP) would probably feel right at home with Fowler's recommendations of refactoring in duets and unit testing, but developers stuck with a Software Engineering Institute process like PSP categorize testing as failure time and something to be minimized if not avoided. Cleanroom developers are taught that unit testing inteferes with metrics for quality, and that verifications are what should be done. Should such developers redo verifications after each refactoring? There's no answer in this book. An unusual chapter, called "Bad Smells in Code," gives overall motivation for the refactorings. These vague notions, such as "long methods" or "lazy classes" humorously provide a foundation for starting your own refactorings. I say "humorously" because (mostly) Beck's and Fowler's odd analogies (classes becoming too intimate and delving in each others' private parts) provoke a chuckle (as if a chapter about "bad smells" in code weren't enough). Overall, I've enjoyed reading this book and referring to the catalog while putting my own unit tests and refactorings into practice. Fowler's writing style is smooth and fluid, and it's easy to digest the catalog in no time. The book's typesetting is crisp, the figures quite clean, and both the refactoring index and "smell" index are enormously useful.
101 of 110 people found the following review helpful:
5.0 out of 5 stars
Refactoring: Improving the Design of Existing Code,
By
This review is from: Refactoring: Improving the Design of Existing Code (Hardcover)
A little while back I was introduced to a word I had never heard before, Refactoring. I was told to get Martin Fowler's book and read it so I could gain a better understanding of what Refactoring was. Well folks, I would classify this book as a 'Hidden Treasure'. Although it is not a flashy or well known title, I believe its impact can be much deeper and long There are only a couple of things I would change about this book, which I will mention below. Preface Chapter 1: Refactoring, a First Example In this chapter Mr. Fowler tries to start by showing a simple Refactoring example. The problem is Chapter 2: Principles of Refactoring Chapter 3: Bad Smells in Code Chapter 4: Building Tests Chapter 5: Toward a Catalog of Refactorings Chapter 6: Composing Methods Chapter 7: Moving Features Between Objects Chapter 8: Organizing Data Chapter 9: Simplifying Conditional Expressions Chapter 10: Making Method Calls Simpler Chapter 11: Dealing with Generalization Chapter 12: Big Refactorings Chapter 13: Refactoring, Reuse, and Reality Chapter 14: Refactoring Tools Chapter 15: Putting It All Together One other thing I would change about the book is that I would want there to be examples in other Well as I said above, this book is really what I would consider a 'hidden treasure'. The things
23 of 23 people found the following review helpful:
5.0 out of 5 stars
Making tired old code better,
This review is from: Refactoring: Improving the Design of Existing Code (Hardcover)
The basic thesis of this book is that, for various reasons, real programs are poorly designed. They get that way for a variety of reasons. Initially well designed, extending the program may lead to software decay. Huge methods may result from unanticipated complexity. Refactoring, according to Fowler, is a function preserving transformation of a program. The transformations are reversible, so the intention is to improve the program in some way.Fowler suggests refactoring a program to simplify the addition of new functionality. The program should also be refactored to make it easier for human readers to understand at the same time. He also insists that each step is small and preserves functionality, and on frequent unit testing with a comprehensive test suite. Half of the book consists of a catalogue of refactorings. He gives each refactoring a memorable name, such as "Replace Type Code with Subclasses". He illustrates the design transformation with a pair of UML class diagrams, and has a standard set of sections: Motivation, Mechanics and Example. The Motivation is a prose section that describes and justifies the refactoring, showing the relationship to other refactorings. The Mechanics is a sequence of steps needed to carry out the refactoring, shown as a list of bullet points He expands on some points. The Example is where the value of this book lies. Fowler takes a fragment of Java code, and takes us step by step through the refactoring. The code is small enough that he can show it all each step of the way without overwhelming us, but is large enough to be realistic. The code is clear enough for non-Java programmers to follow. He explains his code well enough for the book to function as a Java tutorial where the meaning of the code is not obvious. One or two of the refactorings are specific to the Java object model, and do not apply to other languages. Other languages would benefit from similar treatment, but there are very few language-specific refactorings. The book is very much of the Design Patterns movement, with frequent references to patterns. The aim of a factoring may be to achieve a particular pattern, or it may take advantage of a particular pattern. The book can be used as a tutorial on Design Patterns. I have a small number of complaints. Fowler advocates the use of refactoring while studying code for a code review. One needs to be very sensitive to the feelings of the programmer here, especially if he or she is a novice. The reviewer should read the code with refactoring in mind, and possible refactorings recommended, but it is for the programmer to make the changes. Reading this book has inspired me to refactor some of my own code. My mistakes underlined the need to take small steps, and to test frequently. I spent a day building a useful Delphi testing framework from the description Fowler gives of the JUnit testing framework. The one category of code that does not seem to lend itself to this approach is some highly coupled parsing code. While I can extract small blocks of code, they remain tightly coupled with each other, and it is hard to give them meaningful names. The answer here may be to use the top down approach of recursive descent, rather than the bottom up approach of refactoring. Perhaps recursive descent can guide refactoring. Refactoring is largely a local approach. One can almost say a pinhole approach. Sometimes a global view is needed. In summary, I would say that this very good book would be of use to Java programmers who have some understanding and much bafflement. It is very good for us older dogs who have become a little jaded and need some new ideas and motivation.
38 of 41 people found the following review helpful:
5.0 out of 5 stars
Don't just read it - buy it,
By
This review is from: Refactoring: Improving the Design of Existing Code (Hardcover)
One can read good books on a specific technology (COM, UML etc) or on specific programming languages or even on different approaches to software development (RUP, OPEN etc) but every now and then a true classic comes along. Like Design Patterns 4 years ago now refactoring comes along. Every serious OO developer should own both of these books. Get your hands on Refactoring if only to read chapter 3, which summarises all the 'bad smells' that may creep into code. 21 generic examples of what is bad programming and why. The remainder of the book describes numerous techniques (refactorings) for changing existing code in order to remove the 'smell'. Most refactorings are accompanied with some UML, which should be enough to get the idea, and they are then further described in Java. What makes this great a book is that it can be used as a reference very easily since its design was well thought out for this purpose with a comprehensive index and tables matching smells and respective refactorings. If any of this rings a bell to CODE COMPLETE readers it should cause the ideas are very similar but very much updated here. Fowler's writing style makes once again for easy, pleasant reading. Unreservedly recommended.
19 of 19 people found the following review helpful:
5.0 out of 5 stars
Don't wait as long as I did,
By
This review is from: Refactoring: Improving the Design of Existing Code (Hardcover)
I've known about this book for over a year. Initially, I thought it was about re-engineering legacy systems. I don't do that, so I didn't give it much thought. Over the past year, I have stumbled across repeated references to this book. Everyone seems to cite it, and now I understand why. It's very easy to fall into 'analysis paralysis' when doing object design. A commonly heard complaint is "I have created 27 different class diagrams, and 42 separate sequence diagrams, but I can't seem to get any code written..." XP's popularity is due, in part, becuase it get's you into action--you begin writing code immediately, instead of creating diagrams for weeks (or months) on end. XP's motto could be "just do it!" But how does one reconcile this "code first, ask questions later" mentality with an acknowledged need to at least do some design work? In "Refactoring", Martin Fowler provides the answer. His prescription is to create some code to get something working, then look at the code to see how it might be improved-- refactor it. In Fowler's view, you won't really understand the problem until you have coded it, so instead of spending the next three weeks trying to find the perfect pattern for your next task, forget the pattern, and get some code going. Once you've got something workable, then think about patterns you might back into from your existing code. Of course, that's a gross oversimplification of the process, but it gives a flavor of the ready-fire-aim process that 'Refactoring' is built around. And it seems to work--even people who don't buy into other core practices of XP seem to have adopted refactoring as a central element in their process. The catalog of refactorings that the books provides are a first class reference on how to clean up particular problems. But to me, the most valuable part of the book is its first fifty pages. Fowler starts the book with a simple, but ugly, example, that he proceeds to refactor, step-by-step, into something rather elegant. If you like to learn principles first, you might want to read the second chapter before going through the example, but I found it a very valuable exercise. I recommend coding the example in your language of choice, then refactoring along with Fowler as you work through the example. There is a temptation to relegate refactoring, like testing, to simply another development technique. But like testing, refactoring is at the core of a development philosophy: "I know I'm not going to get it right on my first pass, so I'll be satisfied with making it as right as I can. Having done that, I'll have a much better idea how to make it better, and I will. But time's a' wasting, so I need to get moving." This philosophy of continuous improvement allows the developer to get into action fairly quickly, and it reduces the risk of failure-by-delay. Fowler's book is a top-notch resource that will help the developer create more flexible code more quickly. I can recommend 'Refactoring' without reservation.
16 of 16 people found the following review helpful:
5.0 out of 5 stars
Should be part of every developer's toolkit,
By A Customer
This review is from: Refactoring: Improving the Design of Existing Code (Hardcover)
I spent seven years in the Smalltalk environment figuring (parts) of this stuff out for myself. You don't have to - buy Martin's book and shave at least a few years off the learning curve. Refactoring is an indispensable part of software development. Like it or not, whatever you write today will be "wrong" sometime in the future. You need to have techniques for transitioning to the "right" stuff. Refactoring provides you with a wealth of small tools that can make the transition easier. Not only that, having confidence that you can refactor your code later (supported by relentless testing) actually relieves some of the pressure you feel when you write the code the first time. Get it working, then get it right. Don't panic. Don't sweat. Enjoy your work like you did when you started (remember?). Let Refactoring guide the way. A practical guide for any OO developer, no matter what language you are working in, though you need enough familiarity with Java to read the examples.
13 of 13 people found the following review helpful:
1.0 out of 5 stars
The Kindle version is broken,
By Adrian El Matador! Secord (New York, NY United States) - See all my reviews
Amazon Verified Purchase(What's this?)
This review is from: Refactoring: Improving the Design of Existing Code (Kindle Edition)
The content itself is excellent -- the discussion of refactoring is absolutely great. I would give the content itself a good four or perhaps five stars.
Sadly, the Kindle version is broken. The book uses example code before a refactor and after a refactor to illustrate its points, and I believe in the print version the two versions are displayed side by side. Unfortunately, in the Kindle version this side-by-side layout is destroyed, making the comparisons useless. I have read over twenty Kindle editions of books on the iPhone, iPad and my desktop, and I've never felt disappointed. Sadly, the Kindle version of "Refactoring" feels like a waste of money.
11 of 11 people found the following review helpful:
5.0 out of 5 stars
Great book on a variety of levels.,
By
This review is from: Refactoring: Improving the Design of Existing Code (Hardcover)
First, a bit of information about where I'm coming from. 10 years ago I came away with a Computer Science minor but never really utilized the programming skills I'd learned in any of my subsequent jobs (Marine Biology). However, I did dabble in teaching myself C++ and loved the concept of Object Oriented programming. Recently I landed a job working with IDL (Interative Data Language - NOT Corba IDL) which was originally designed to create quick 2D and 3D plots and images for scientists. While still primarily a scientist's language, it has been adding more and more features, including Object Oriented support.So this means, I'm now a programmer. My new boss really wants almost everything done as an OO design, which I was more than happy about. However, much of my work will be to modify/extend old code which is in every form from procedural to pseudo-OO (uses a few objects here and there but is still mostly procedural). I originally convinced the boss to pick up this book by pointing out the section on converting Procedural Code to OO. Turns out this section is very short, but gives an overview of how to do it using the other refactorings in the book. So it's helpful there. One place I haven't seen it mentioned in many reviews is the benefit this book can have for someone new to programming professionally (note, I do NOT mean to imply that this is a beginner programmer's book, you should have a good understanding of OO programming already). It has already had many benefits for me: 1. Smells in Code: I love this section. As everywhere in the book, it applies directly to poring through old code and picking out the 'smells' present that indicate poorly structured code. But it's also as valuable in pointing out what to watch for as you write a new program. The book does advocate a design/refactor approach, and this is the best example of it. As you design, you notice one of the 'smells' creep into your code, and you can refactor it then and there. This has been of immense value to me in my first programming projects. 2. Advocation of testing: I already have Kent Beck's "Test Driven Development" and utilized some concepts from it, but "Refactoring" also talks about testing, and it seems to flow much better for me in Fowler's book as far as understanding how to use tests. It 'clicked' when he mentioned that most of the time spent creating a program wasn't design/programming, but rather tracking down a bug. Combining quick and frequent tests on new refactorings (or just new bits of code added in) focuses the programmer very swiftly on just what went wrong. The longest I've ever spent puzzling out a bug so far on my first major project has been 30 minutes, and that's because I forgot a return statement. As soon as I got up, took a break and sat back down it was obvious. Most other bugs have been along the lines of "run the test, watch it crash, fix within 2-5 minutes". 3.Ideas on how to structure code I haven't written yet: Maybe "Design Patterns" is a better book for this, but everytime I've looked at it, it overwhelms me. "Refactoring" somehow seems to put into focus more clearly how to fix a problem that's stumping me. For example, the program I'm working on requires two ways of creating a new object. One creates it directly from a file, one creates it from a GUI where all data is entered, and then added by hitting the 'create' button. I got the 'initFromFile' constructor working nicely and then proceeded to start work on the 'initFromGUI', recreating most of the steps until I hit the point where the object had to create a linked list based on the number of swimbladders (each of which is an object in the linked list) within the main fish object. Long story short, I thought about creating the object separately and just passing it in as a parameter, but besides requiring more knowledge of the object the GUI was working with than I wanted the GUI to have, it also led to one Init call with a huge list of parameters). So I flipped through "Refactoring" and found "Duplicate Observed Data" which described the exact problem I was trying to solve and goes into enough detail on using the 'Observer' Pattern that I was able to get my code to work in a much cleaner fashion than I would have otherwise. 4. Teaches the 'obvious' to new programmers: Some of the complaints I've read involve "Well, any real OO programmer knows this already, it's a waste of space to include that." In my case this is not necessarily true. Some of the refactorings are indeed obvious to me. Others that are obvious to others are not obvious to me. Even more important, you will see some of these 'obvious' things in previously created 'legacy' code, and this book will allow you to spot it.
14 of 15 people found the following review helpful:
5.0 out of 5 stars
Fantastic resource for developing quality code,
By Jake Well (Windsor, Ontario Canada) - See all my reviews
This review is from: Refactoring: Improving the Design of Existing Code (Hardcover)
I would have to give 2 thumbs up to Martin Fowler's book on Refactoring. He has addressed so many common refactorings in such a simple and elegant way that many will benefit from his work (as well as the others that helped write this book).Martin's writing style is very relaxed and sincere. He's entertaining and doesn't complicate things as you can easily find what you need. You can tell he simply wants to make programming teams' lives easier and he has accomplished tenfold. He's not going to tell you that your an innately bad programmer or that he is a better one - he truely captivates that quality code is important and refactoring is that one big step that each organization and programmer must take to improve the quality of code. Some of the patterns that he identifies are very common - but for completeness' sake, he includes them. Others are very insightful such as Introducing Null objects, which I've used 5 times in a single application now since I've read this book. This is also an excellent book to accompany Design Patterns, as many of these refactorings will help you achieve design patterns in your code - it's like working them in your code in a different, systematic way. All in all, this is a fantastic contribution to improving code and developing quality programmers in the software development industry. I would recommend this to any software professional and especially university students (where quality code is not touched on at all). It's the will of the programmer to improve their code and this is one of those books to read if you want to do that. If you want to just be an average programmer, a following in your organization and not take responsibility - then don't read this book. If you want to truely be effective in your job or entrapreneural projects, add this book to your bookshelf and read it, use it and live it.
9 of 9 people found the following review helpful:
5.0 out of 5 stars
Should be part of every developer's toolkit,
By
This review is from: Refactoring: Improving the Design of Existing Code (Hardcover)
I spent seven years in the Smalltalk environment figuring (parts) of this stuff out for myself. You don't have to - buy Martin's book and shave at least a few years off the learning curve. Refactoring is an indispensable part of software development. Like it or not, whatever you write today will be "wrong" sometime in the future. You need to have techniques for transitioning to the "right" stuff. Refactoring provides you with a wealth of small tools that can make the transition easier. Not only that, having confidence that you can refactor your code later (supported by relentless testing) actually relieves some of the pressure you feel when you write the code the first time. Get it working, then get it right. Don't panic. Don't sweat. Enjoy your work like you did when you started (remember?). Let Refactoring guide the way. A practical guide for any OO developer, no matter what language you are working in, though you need enough familiarity with Java to read the examples. |
|
Most Helpful First | Newest First
|
|
Refactoring: Improving the Design of Existing Code by Kent Beck (Hardcover - July 8, 1999)
$64.99 $43.67
In Stock | ||