Brent comments on his favorite part of software development, which is mine as well – refactoring, “when the code goes from weird but working to clean and maintainable and working much better.”
There is something really satisfying about deleting chunks of code and making things maintainable for the long term.
Refactoring is great. There’s an amazing amount of satisfaction in taking something complex, crufty, and inefficient and turning it into something elegant and simple. It’s especially rewarding when you’re working on someone else’s code and you figure out how all the spaghetti works and then take the scalpel to it. Aaaaah.
Bleah, sometimes refactoring others’ code amounts to rewriting it, though. Especially when you get code from someone whose language of choice is -not- the one in which the code was written. I can’t count the number of times I’ve looked at some Perl and said, “Yep, C programmer,” or “Ick, VB coder.”
But refactoring your own code? Yum. My wife can’t understand why sometimes I take home a one-page source printout and stare at it — it’s because it used to be TEN pages!