Just wanted to hear some words of advice (and comfort.. ) that will help me to take control over some complicated spaghetti code -- code that was developed by multiple programmers (usually that never meet each other) over long time. the solution's features are just patched on top of each other.
Usually I tend to see 2 kinds of programmers:
"Scared-to-death programmers" - those guys will not touch anything that they don't have to. they will probably will complete the maintenance task using a quick and dirty fixes that will make the next programmer to start looking for their home address ;-)
pros:
it works
cons:
you hope you will never see this code again..
"Teachers" - those will probably rewrite the whole code while completely refurbishing its logic.
pros:
well, someone has to do the dirty work...
cons:
takes longer time and probably one of the most critical features will magically disappear from the product
It will be nice to hear your personal experience from this darker side of the programmer's life.
I am specifically curious to hear any theoretical/hands-on advice that will help me to dive into the spaghetti maintenance task without feeling so miserable.
I try to wrap really bad legacy code in tests before I start. I pretty much smother it in tests, to be honest! Then I have some confidence in diving in an refactoring it where I need to.
You might like to read
Working Effectively with Legacy Code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With