Relocate for Reuse
Relocate for Reuse
Code Craft
All code is not created equal. Learn from a master of the craft how to spot bad code and mold it into good. This month, Mike Clark explains how moving code from one class to another to make it reusable can save you time in the long run.
When we last left our code, it was trying to tell us a secret. This isn't that uncommon. Code wants to be responsive to change, and when it doesn't get its way it tries to warn us. But often we aren't listening because it's too easy to plow ahead to the next feature. Unfortunately, in our haste we miss a golden opportunity to improve the code, which is actually the design. And although the consequence of ignoring the code isn't immediately noticeable, it quickly starts to drive up the cost of change.


