2 ms·
"Where have all good programmers gone? ... What I noticed is that there were few or no conferences without a topic of refactoring. ... Why can’t we write a good
by greenyoda 12y ago
"Where have all good programmers gone? ... What I noticed is that there were few or no conferences without a topic of refactoring. ... Why can’t we write a good code from the very beginning?"
The author of this article seems to think that refactoring is only used to clean up messes created by bad programmers. He completely ignores one of the major uses of refactoring, which is to evolve a code base so that new functionality can be added to it. No matter how well-written a piece of code is, it will need to change to support new requirements that couldn't have been predicted at the time it was written. (gregjor's excellent earlier comment goes into this in more detail.) Any successful software application that survives more than a few months will need to undergo this kind of evolution. Think of all the features that have been added to Amazon.com or Facebook since these sites were launched. The fact that Amazon's original architecture from 1994 didn't support streaming videos doesn't mean its developers were inept - there was no such technology at the time.
Also, even good programmers can write bad code if they're under time or cost pressure. For example, if your aim is to quickly launch a startup with limited funds, you might cut corners on code quality and scalability, intending to clean up the code later if the business achieves market traction and positive cash flow. At that point, knowing some of the subtleties of refactoring technique could be very useful.