good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Maintenance vs. Programming styleby talexb (Chancellor) |
on Jan 29, 2008 at 17:42 UTC ( [id://664932]=note: print w/replies, xml ) | Need Help?? |
That depends. Do you want to get in and get out, or are you going to turn this into a career?
Sure. And are there exhaustive tests that you can run to verify that your "cosmetic" changes don't make any of the tests fail? And what's the risk?
I have a confession to make. My code is usually pretty terse, but I suffer from over-commenting. So I'll write something brief, then spend the next five lines explaining what I just did (or what I'm about to do, since I put comments ahead of the code). I'm just terrified of coming back to my own code in six months to a year's time and being unable to grok what it's doing.
Nope -- I get in, make the smallest possible change, look over it *very* carefully, do as much testing as possible, and get out. I don't even muck with the indentation. You've heard the phrase "The road to hell is paved with good intentions"? Many of those good intentions are a variation on "But I only made a small change to the code! It shouldn't have changed anything!" Great question.
In Section
Meditations
|
|