10 August 2011

Put a Diaper On It

Inspired by Adam Machanic's T-SQL Tuesday topic of 'Crap Code' I decided to take a bit of a different bent--preventing crap code.  Instead of coming off as incredibly arrogant by admitting that I cannot recall code that I have written that I am embarrassed of, I thought to answer why that is.

There is definitely code that I revisit that I would like to rewrite bits of.  Generally, this is because I am better today than when I wrote the code; learned a new trick, new version has a better function, got a bit more sleep. So what is it that prevents, or at least corrals, crap code?  Defined purpose and consistent code.  If your code explains why it is doing what it does and is consistently formatted, it is hard to argue with your original reasoning.

So go easy on yourself, jamiet--that is not crap code, that is good code dealing with crap.

No comments: