On the cover of the Addison-Wesley Second Edition, he is quoted as saying:
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand".
Erich Gamma (one of the "Gang of Four" behind Design Patterns) remarks in the preface that refactoring began in "Smalltalk circles" and found its way into other programming language camps.
He also emphasises its core role in framework development.
"Frameworkers know that a framework won't be right the first time around—it must evolve
as they gain experience...The key to keeping code readable and modifiable is refactoring—for frameworks, in particular, but also for software in general." - Erich Gamma
Erich expands on the risk of refactoring - the fact it can set you back days or weeks and "refactoring becomes riskier when practiced informally or ad hoc".
Erich emphasises that a system is needed for successful refactoring: "To avoid digging your own grave, refactoring must be done systematically".
He mentions the core of the book is a "comprehensive catalog of refactorings".
He also relates a coding session with Kent Beck involving disciplined "one step at a time" refactoring and how we felt afterwards -
"Not only did my confidence in the resulting code increase, I also felt less stressed."
No comments:
Post a Comment