Home :: Books :: Computers & Internet  

Arts & Photography
Audio CDs
Audiocassettes
Biographies & Memoirs
Business & Investing
Children's Books
Christianity
Comics & Graphic Novels
Computers & Internet

Cooking, Food & Wine
Entertainment
Gay & Lesbian
Health, Mind & Body
History
Home & Garden
Horror
Literature & Fiction
Mystery & Thrillers
Nonfiction
Outdoors & Nature
Parenting & Families
Professional & Technical
Reference
Religion & Spirituality
Romance
Science
Science Fiction & Fantasy
Sports
Teens
Travel
Women's Fiction
Refactoring: Improving the Design of Existing Code

Refactoring: Improving the Design of Existing Code

List Price: $54.99
Your Price: $40.22
Product Info Reviews

<< 1 2 3 4 .. 11 >>

Rating: 5 stars
Summary: Should be part of every developer's toolkit
Review: 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.

Rating: 5 stars
Summary: A future classic; ranks alongside _Design Patterns_
Review: It's rare that I find a technical book as immediately useful and fun to read as _Refactoring_. The cleverest thing about refactoring as a technique is that it provides a well-articulated, structured framework for doing something that every experienced developer does already (more or less unconsciously) -- constantly restructuring their code to make it easier to understand and maintain. This alone makes refactoring a useful contribution to software engineering.

However, Fowler doesn't stop there. He presents rationales for refactoring (with an eye towards making a case to management) and much detailed, practical insight that comes from experience, but is rarely expressed so concisely and elegantly. I also appreciated the importance Fowler placed on unit testing; in fact, using unit testing makes refactoring happen much more quickly, and leaves you with a lot more peace of mind besides.

I read the book cover to cover and enjoyed nearly every page. The book has added a lot to my value as a developer, and was a lot of fun in the bargain. I don't think a whole lot more needs to be said. Just buy it, you can thank everyone who told you to later.

Rating: 5 stars
Summary: Great book on a variety of levels.
Review: 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.

Rating: 5 stars
Summary: Refactoring: Improving the Design of Existing Code
Review: 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
lasting than many of the mainstream, more popular technology books. The underlying theories
that it teaches can be applied for years, even when languages change.

There are only a couple of things I would change about this book, which I will mention below.

Preface
The Preface it brief enough, and gives the definition for the word Refactoring. This is a good thing
because right form the start you get the true definition of Refactoring. In short, refactoring is the
process of changing code to improve the internal structure, but not changing the external
behavior.

Chapter 1: Refactoring, a First Example

In this chapter Mr. Fowler tries to start by showing a simple Refactoring example. The problem is
that the chapter then goes on for 50+ pages. Mr. Fowler explains his reasons for doing this, but I
think that a simple example should have been much simpler. Especially when it is in the first
chapter of the book. It's not that this isn't a good chapter. I feel it's just too soon in the book. I
would have put it at the end.

Chapter 2: Principles of Refactoring
This is an excellent chapter. The definition of Refactoring is discussed as well as the following
questions: Why should you refactor? When should you refactor? What do I tell my manager? This
last question may seem funny, but when you read this chapter you will understand why it is in
there. This chapter also discusses common problems that occur during Refactoring, and
Refactoring and performance.

Chapter 3: Bad Smells in Code
In this chapter things that cause code to 'smell' are discussed. When code 'smells' it could be an
indicator that refactoring is needed. 22 different 'smells' are discussed. My favorites were
Duplicated Code, Large Class, and Lazy Class. This is a chapter full of awesome hints.

Chapter 4: Building Tests
Building tests is an important part refactoring. Refactoring is done in small steps, and after every
step you should test. In this chapter the discussion covers the processes and methodology of
applying tests during refactoring.

Chapter 5: Toward a Catalog of Refactorings
This chapter is a quick setup for chapters 6 to 12. Mr. Fowler explains his method for cataloging
the individual refactorings. What is pretty amazing is that he has taken a lot of time naming and
detailing each refactoring.

Chapter 6: Composing Methods
One of my favorite chapters. Mr. Fowler opens by saying, "A large part of my refactoring is
composing methods to package code properly." This chapter is all about that. 9 total refactorings
are explained. My favorite ones are Inline Method and Extract Method.

Chapter 7: Moving Features Between Objects
Sometimes you need to move things from one object to another. This chapter discusses the art of
moving features between objects. 8 total refactorings are discussed and detailed. My favorite
from this chapter is Extract Class.

Chapter 8: Organizing Data
A very large chapter that discusses in meticulous detail 16 refactorings that will make it much
easier to work with data. One thing that becomes very obvious in this chapter is that certain
refactorings can go either way. What I mean is illustrated by these two: Change Value to
Reference and Change Reference to Value. So some refactorings are not just one way deals. It
just depends on the situation.

Chapter 9: Simplifying Conditional Expressions
This is a very useful chapter since conditional logic is a common occurrence in the programming
world. Because conditional logic has a tendency to get very complex, this chapter has 8
refactorings that will help you simplify things.

Chapter 10: Making Method Calls Simpler
The 15 refactorings in this chapter help teach us how to make method calls easier to deal with.
They range from the very simple Rename Method to the more complex Replace Constructor with
Factory Method.

Chapter 11: Dealing with Generalization
Here are 12 refactorings dealing with the situations that arise from generalization. Inheritance,
Delegation, and Interfaces are some of the topics discussed.

Chapter 12: Big Refactorings
Kent Beck co-wrote this chapter with Mr. Fowler. They discuss what they call the 4 Big
Refactorings: Tease Apart Inheritance, Convert Procedural Design to Objects, Separate Domain
from Presentation, and Extract Hierarchy. These refactorings are of a more all-encompassing
type than the smaller individual refactorings from the preceding chapters. The co-authors do a
great job at putting in a nutshell what would normally take very long explanations.

Chapter 13: Refactoring, Reuse, and Reality
William Opdyke writes this chapter. He discusses his experiences with refactoring as well as
other subjects like why developers are reluctant to refactor and reducing the overhead of
refactoring. This chapter is an excellent 'putting it all together' chapter, and really helps put into
perspective the ideas that the book teaches.

Chapter 14: Refactoring Tools
Don Roberts and John Brant co-author this chapter. They discuss, as the chapter title would
indicate, refactoring tools.

Chapter 15: Putting It All Together
Kent Beck gives a quick 4-page wrap up.

One other thing I would change about the book is that I would want there to be examples in other
languages besides Java. I have practically no Java skills. For me the book would have been an
easier and faster read if it would have had examples in VB.net. Fortunately I understand enough
to get the idea of what is being taught, and that is the most important point.

Well as I said above, this book is really what I would consider a 'hidden treasure'. The things
discussed will help many people write better, more understandable code for years to come. I
would give it a 9.5 out of 10. It is well worth the {price}

Rating: 5 stars
Summary: Don't just read it - buy it
Review: 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.

Rating: 3 stars
Summary: Fowler's First Example: Won't Compile, Won't Run
Review: Folwer's First Example: Won't Compile, Won't Run

Fri 5/07/04 7:07 pm. I am a professional programmer, and have been refactoring long before anybody told me about it. Fowler's first example is broken. Specifically:

1. "import java.util.*" omitted in Customer.java. This is the kind of thing it's very difficult to guess; the Sun compiler flags "Vector" and "Enumeration" with no hint of what to do about it (environments like JBuilder etc. are probably more helpful).

2. Page 11 has a misplaced curly bracket, leaving the "amountFor" routine out in the cold.

3. There is no program; Fowler shows us classes, and mentions that he tests them, but neither is shown. At least not before page 11.

This is particularly puzzling because Fowler claims it's very important to test everything constantly -- and it is obvious these classes cannot be tested because they cannot compile. And they won't run, because there is no program; surely it makes a difference *which* tests or program the classes are run under?

CONCLUSION: the information Fowler has to impart would be useful for those who don't know it; but typically these will be beginning programmers, and they may well be confounded by the broken example code at the beginning of the book.

Rating: 5 stars
Summary: Masterly, Comprehensive Reference on Refactoring
Review: The refactoring concept fits perfectly with extreme programming (XP).

XP (aka ready-fire-aim) recommends that developers get the solution coded and working ASAP (without big-up-front-design or analysis-paralysis) and then (shed your inhibitions; you won't really understand the problem until you've coded it) gradually improve on the design by refactoring the code.

This very accessible book has contributions from Kent Beck, John Brant, William Opdyke, and Don Roberts.

The author uses fragments of Java code to demonstrate refactoring.

The book contains a section on code "smells" that identify ugly code and a catalog of about 50 refactoring patterns, diagrammed using UML and documented per the template popularized by "Design Patterns: Elements of Reusable Object-Oriented Software" by Erich Gamma et al.

In his book "Extreme Programming Explained: Embrace Change," Kent Beck has this to say about Martin Fowler's book "The reference for refactoring. Get it. Study it. Use it."

Rating: 5 stars
Summary: Great book for the professional
Review: I got this book at the recommendation of another book (Ken Henderson's Guru's Guide to Stored Procedures) and was simply blown away by it. I have been preaching the lessons this book tries to teach for years. Now I finally have a text I can point people to to say "Hey, this code is really broken even though it still runs. We need to fix it!" Thank you, thank you, thank you for such a wonderful book.

Rating: 5 stars
Summary: An instant classic
Review: This remarkable book is the next logical step after 'Design Patterns'. In fact, it would be fair to call this 'Re-Design Patterns'.

It follows closely in the DP community's habit. For each way of improving a program, it systematically presents a name, set of conditions when it does or does not apply, and (unlike most DP books) clear, demonstrative examples and variations. As with design patterns, many of these recommendations have a sense about them of "I already knew that." That's a good thing - it means you bring familiarity to the reading, instead of starting cold. That lets Fowler get on with his real business, which is to systematize the knowledge and regularize the process of choosing a technique to use.

I hope this follows another habit of the DP community, too: the public cataloging, collecting, and sharing of new techniques for refactoring. I could add bunches to the list, as I'm sure any other seasoned programmer could. One thing is distinctive about the refactorings: the number that come in matched, opposite pairs. This just emphasizes the context dependency of refactoring - each technique has its place, but is not appropriate in all places. Also, paired opposites effectively double the number of choices a practitioner has.

Design patterns are very helpful, almost like power tools for programmers. Face it, though: initial design and implementation are only 1-10% of a large program's life. Maintenance, extension, and re-design are the other 90-99%. DP techniques get a program started, refactorings keep it going.

If you started programming before most of your co-workers were born, you may not get the most out of this book. Get it anyway, and make sure the young pups read it. This knowledge needs to be spread.

Rating: 5 stars
Summary: Great reference for when and how to change existing code
Review: Great advice on when, how, and where to refactor. It also surprised me by having a bit more relevant stuff for big projects than the usual software principles and practices books do -- I'm used to having to extrapolate for myself. In addition to the great text, there's also a wonderful encyclopedic list of transforms. They're understandable enough to read and perform as a human, but also semantically well-defined enough to make tools almost directly on top of.

The last few chapters unfortunately felt 'stapled' onto the end. They all had a very different feel from the rest of the book and, while they were interesting viewpoints, they made it lack some consistency. It would've been good to have either Fowler-ized them or just left 'em out. I'm not clear how much value they added, other than saying, "Tools are good to do refactorings. Without them, people aren't too religious about it. But don't trust the tools too much; baby-steps and test verifiction is still crucial."


<< 1 2 3 4 .. 11 >>

© 2004, ReviewFocus or its affiliates