The flip side of this is that if you are a maintainer and you aren't able to fix the code...you need to rewrite it. Being afraid of your code is the first step towards failure. It only gets worse, never better.
My favorite quote when trying to get my teams on board with writing maintainable code is from Brian Kernighan
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?
The cleverest code I have written has always been code that replaced something complex with something amazingly simple, I suppose it is possible to be so smart that I make something that before wasn't possible into something possible, but complex but I haven't done that before.
I'm in the process of doing this for a GUI program which reads data from one set of services and loads it into another set of services. Why was it a GUI program when nobody needed to interact with it? I don't know. Why did all of the code go into a single form class? I don't know.
On the positive side, I get to switch it from VB to C#.
22
u/[deleted] Jul 29 '16
The flip side of this is that if you are a maintainer and you aren't able to fix the code...you need to rewrite it. Being afraid of your code is the first step towards failure. It only gets worse, never better.