- File Size: 15915 KB
- Print Length: 461 pages
- Simultaneous Device Usage: Up to 5 simultaneous devices, per publisher limits
- Publisher: Addison-Wesley Professional; 1 edition (March 9, 2012)
- Publication Date: March 9, 2012
- Sold by: Amazon Digital Services LLC
- Language: English
- ISBN-10: 013306526X
- ISBN-13: 978-0133065268
- ASIN: B007WTFWJ6
- Text-to-Speech: Enabled
- Word Wise: Not Enabled
- Lending: Not Enabled
Amazon Best Sellers Rank:
#100,025 Paid in Kindle Store (See Top 100 Paid in Kindle Store)
- #18 in Kindle Store > Kindle eBooks > Computers & Technology > Programming > Software Design, Testing & Engineering > Object Oriented Design
- #140 in Books > Computers & Technology > Programming > Software Design, Testing & Engineering > Object-Oriented Design
- #22980 in Kindle Store > Kindle eBooks > Nonfiction
Refactoring: Improving the Design of Existing Code (Addison-Wesley Object Technology Series) 1st Edition, Kindle Edition
Customers reported quality issues in this eBook. This eBook has: Typos.
The publisher has been notified to correct these issues.
Quality issues reported
Use the Amazon App to scan ISBNs and compare prices.
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
Customers who bought this item also bought
Would you like to tell us about a lower price?
Top customer reviews
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.
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.