Refactoring

Posted on November 21, 2007

Except from RailsSpace:

It may seem like we’re cheating a bit here; after all, the refactored function is so much more compact only because we brushed the code complexity dust under an abstraction layer rug. This practice doesn’t necessarily result in less total code, so does it really do us any good? Absolutely — even when they don’t save us any lines of code, abstraction layers reduce the mental overhead of programming by allowing us to ignore irrelevant details and focus on higher-level constructs. Of course, by eliminating or preventing code duplication, abstraction layers nearly always result in fewer lines of code as well.

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

Comments