Code Craft: Staying Out of Code Debt

(Fri Dec 02, 2005) [/CodeCraft#

In the final installment of my Code Craft column, "Staying Out of Code Debt", I offer some approaches to keeping your code smelling fresh and clean. More important, it may well help you get more done in less time.

Code Craft: Relocate for Reuse

(Tue Oct 18, 2005) [/CodeCraft#

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.

In the latest installment of my Code Craft column, "Relocate for Reuse", we stop to listen to the code. Heeding its warnings, we find a new home for small methods that fell out of earlier refactorings, and end up with code that can be reused.

Code Craft: Clean and Green

(Thu Sep 15, 2005) [/CodeCraft#

In the latest installment of my Code Craft column, "Clean and Green", we use safe and simple refactorings to clean up the mess we made last month.

Code Craft: Reduce Stress, Write a Test

(Tue Jul 19, 2005) [/CodeCraft#

Writing pristine code isn't enough. Without tests, you don't have the confidence to modify the code predictably. Rather, every time you touch the code a cold chill runs up your spine and your typing fingers tremble with fear. You've been bitten before—an innocent change here unknowingly breaks something over there, and what you thought would take mere minutes has turned into several painstaking hours. And so the police tape is strung permanently around the code, workarounds are used to spare the team from going into those crime scenes, and before long what once was the cleanest code on the planet has decayed into the nastiest code imaginable.

It doesn't have to be this way. In the latest installment of my Code Craft column, "Reduce Stress, Write a Test", we drive out fear and boost productivity with the help of a test.

Code Craft: Write Sweet-Smelling Comments

(Wed May 18, 2005) [/CodeCraft#

Comments. Write too many and it may be a sign that your code smells. Write too few and the next person is left wondering why something was done.

In the latest installment of the Code Craft column, Write Sweet-Smelling Comments, I explain my approach to striking a balance.