Monday, February 25, 2013

Keep it Clean

As a developer, I was paid the ultimate complement by a coworker last week.

"Hey, that PowerShell script you wrote is really clean." he said in passing.

This was a script that I had ported from another language, then tweaked and forwarded to him to help manage some server resources. It was an ugly hack originally intended to solve a personal need, but I re-factored it to make it more modular, simpler, readable and added a few key comments.

The main benefit to clean code is that it's easy to come back months later and modified to suit your needs without having to do some sort of digital archaeology. But the best outcome is when others can use it and maintain it without any additional assistance from yourself.

No comments:

Post a Comment