logo

Quotes from Martin Fowler

When you find you have to add a feature to a program, and the program's code is not structured in a convenient way to add the feature, first refactor the program to make it easy to add the feature, then add the feature.
~ Martin Fowler
Poorly designed code usually takes more code to do the same things, often because the code quite literally does the same thing in several places.
~ Martin Fowler
Other than when you are very close to a deadline, however, you should not put off refactoring because you haven't got time. Experience with several projects has shown that a bout of refactoring results in increased productivity. Not having enough time usually is a sign that you need to do some refactoring.
~ Martin Fowler
You can Change Your Organization or Change Your Organization
~ Martin Fowler
In almost all cases, I'm opposed to setting aside time for refactoring. In my view refactoring is not an activity you set aside time to do. Refactoring is something you do all the time in little bursts.
~ Martin Fowler
I've found that refactoring helps me write fast software. It slows the software in the short term while I'm refactoring, but it makes the software easier to tune during optimization. I end up well ahead.
~ Martin Fowler
Parallel inheritance hierarchies is really a special case of shotgun surgery. In this case, every time you make a subclass of one class, you also have to make a subclass of another.
~ Martin Fowler
Now I'm a pretty lazy person and am prepared to work quite hard in order to avoid work.
~ Martin Fowler
Life being what it is, you won't get your names right the first time. In this situation you may well be tempted to leave it—after all it's only a name. That is the work of the evil demon Obfuscatis; don't listen to him. If you see a badly named method, it is imperative that you change it. Remember your code is for a human first and a computer second. Humans need good names.
~ Martin Fowler
It's more than a little ironic that many of us preach safety first to our children, nieces, and nephews but in our roles as programmers scream for freedom, a hybrid of the Wild West gunslinger and teenage driver. Give us freedom, give us the resources, and watch us fly.
~ Martin Fowler
It reminds me of a statement Kent Beck often makes about himself: "I'm not a great programmer; I'm just a good programmer with great habits." Refactoring helps me be much more effective at writing robust code.
~ Martin Fowler
First Law of Distributed Object Design: Don't distribute your objects!
~ Martin Fowler
Architectural refactoring is hard, and we're still ignorant of its full costs, but it isn't impossible. Here the best
~ Martin Fowler
If someone were to come up to you in a dark alley and say, "Psst, wanna see a UML diagram?" that diagram would probably be a class diagram.
~ Martin Fowler
A statement Kent Beck often makes about himself, "I'm not a great programmer; I'm just a good programmer with great habits.
~ Martin Fowler
People sometimes ask me what length I look for in a method. To me length is not the issue. The key is the semantic distance between the method name and the method body. If extracting improves clarity, do it, even if the name is longer than the code you have extracted.
~ Martin Fowler
in interaction diagrams], comprehensiveness is the enemy of comprehensibility.
~ Martin Fowler
If you have to spend effort looking at a fragment of code and figuring out what it's doing, then you should extract it into a function and name the function after the "what".
~ Martin Fowler
It's hard to figure out what the right amount of hiding is. Fortunately, with Hide Delegate (189) and Remove Middle Man, it doesn't matter so much. I can adjust my code as time goes on. As the system changes, the basis for how much I hide also changes. A good encapsulation six months ago may be awkward now. Refactoring means I never have to say I'm sorry—I just fix it.
~ Martin Fowler
The lesson is: Even if you know exactly what is going on in your system, measure performance, don't speculate. You'll learn something, and nine times out of ten, it won't be that you were right!
~ Martin Fowler
Notice how I'm playing the part of an enemy to code. I'm actively thinking about how I can break it. I find that state of mind to be both productive and fun. It indulges the mean-spirited part of my psyche. When you are doing tests, don't forget to check that expected errors occur properly.
~ Martin Fowler