Programming Rule: Don’t fix it if it works!
June 04, 08 by the programmerA colleague of mine told me that, but I did not take it seriously the first time, after I felt it on my skin
.
You know when sometimes you see something in the code and suddenly you think of another solution for the same problem and you think that this will improve the all system, well you know what it wont.
You will probably brake something else while you implement the new solution, it happened to me many times.
So if you notice something that works perfectly don’t try to fix it because it works and you don’t want another problem don’t you.
P.S. This does not apply if there is really something wrong with the code

Mohodin Rageh Says: 05.06.08 at 12:30 am
You are right. It happened to me too. I once tried to fix few non-important things in a live website. I fixed the minor problem and saw no error in my ensuing testing, which obviously was not large-scale enough. Short time later, I got a call from the owner saying that the website stopped working. I can’t explain how I felt. It was ghastly. It was a complex web application and the last thing I wanted was having to deal with unexpected errors. Then I realized that I unwittingly introduced errors while fixing trivial stuff.
A lesson well-learnt
Phatlip12 Says: 05.06.08 at 4:03 am
“you think that this will improve the all system, well you know what it wont.”
Um, no? As a programmer I strive to write the most efficient code possible. Efficient code is fast code. You might break something? Yes, if you try to implement the new code changes without first testing. Thats why you test your code before implementing it.
With all that said, I respectfully disagree with you.
the programmer Says: 05.06.08 at 5:23 pm
Hi
To all of you and thank you for the comments.
It’s nice to hear different opinions. I think that “Mohodin Rageh” understood what I wanted to say with what I wrote.
All I wanted to say was very simple:
“So if you notice something that works perfectly don’t try to fix it because it works …”
I would concentrate on the phrase “something that works perfectly” which means that it works and everybody is happy and there are no problems with this part of the code.
So you saw some non-important , trivial lines of code in your code that even if you change them they will not make any difference, but sometimes a lot of things can depend from just one line of code, and according to the Murphy’s law it will brake something else and create bigger problems.
This is especially true if you make the changes before making a deployment or delivery of your application as “Mohodin Rageh” wrote above.
However if there are some bugs, not optimized parts or something that needs to be fixed, then it needs to be fixed, which means that it does not work perfectly, as I wrote in the above article.
You mentioned testing, you are right, it needs to be tested before deployment and it is tested. But does it worth to find out that you have a bug in the software minutes before deployment or presentation of your application, and on top of that is your boss, and the deadline and who knows what else… just because of a little tiny stupid piece of code
Hmm I don’t think so