Showing posts with label refactoring. Show all posts
Showing posts with label refactoring. Show all posts

Monday, January 30, 2012

A project that does healthy refactoring will be steadily deleting bad code. If nothing's deleted then it's almos certainly a sign that there isn't enough refactoring going on - which will lead to design degradation.

Wednesday, August 31, 2011

If you do get a bug report...

"If you do get a bug report, it's a sign you need refactoring, because the code was not clear enough for you to see there was a bug"

-- Martin Fowler in Refactoring

Monday, August 1, 2011

Choose the simpler design

If a programmer sees a one-minute ugly way to get a test working and a ten-minute way to get it working with a simpler design, the correct choice is to spend the ten minutes. Fortunately, you can make even radical changes to the design of a system in small, low risk steps.

-- Kent Beck

Thursday, July 14, 2011

Who cares if the computer takes a few more cycles to compile something?

"Someone will try to read your code in a few months' time to make some changes. We easily forget that extra user of the code, yet that user is actually the most important. Who cares if the computer takes a few more cycles to compile something? It does matter if it takes a programmer a week to make a change that would have taken only an hour if she had understood your code."

-- Martin Fowler in Refactoring

Wednesday, July 13, 2011

Is renaming worth the effort?

"Is renaming worth the effort? Absolutely. Good code should communicate what it is doing clearly, and variable names are a key to clear code. Never be afraid to change the names of thing to improve clarity. (...)

Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

Code that communicates its purpose is very important. I often refactor just when I'm reading some code. That way as I gain understanding about the program, I embed that understanding into the code for later so I don't forget what I learned."

-- Martin Fowler in Refactoring

Friday, June 24, 2011

About design and refactoring

"The harder it is to see the design in the code, the harder it is to preserve it, and the more rapidly it decays. Regular refactoring helps code retain its shape."