本文发表在 rolia.net 枫下论坛Their clients can buy 1, 2 or all 7 of them. Each module has its own function that share more than 70% code.
Every time I looked on theese functions, I was totally lost; 1000 lines! By the time, I finished line 600, I probably forgot what line 200 is about.
When programmers modify something in module A; they have to go over all other modules to decide if they should do it on module B, C, D, E, F, and G?
At 1 point, I was so mad that I decided to do something about it. I discussed witht the architect and get his blessing to consolidated and optimized all the spaghetti code into just 1 single function. It took me 2 months and I discovered over 50 bugs. I managed to merged them into a function that has less than 40 lines. It is simple and readable.
Every programmer liked it; except.... the BOSS. During our monthly meeting, a programmer said I did great work on this function and asked when I was going to fix all other functions.
My boss called me into his office and complained that I wasted all my time that contributed no added value to the system. I told him that I had discussed with other senior developers and get the green light from our architect. I even showed him how many bug was discovered in this function for the last 2 years and during the 2 months that I optimized it. He still insisted it was a total waste of my time.
I eventually left the company. Before I left the company, I did a very simple predictive model. I did a regression on the time that was spend on fixing the bug vs. number of line in our system and also correlated to how many line we added to the system every month. And my prediction was that within 2 years, they would spend 50%+ of their time fixing bug.
I was wrong! Someone called me just about a years later that their boss was very upset and mad in a monthly meeting because they spend over 50% of their time fixing the bugs!
BTW, anyone see a jumbo class that has over 1000 variables!更多精彩文章及讨论,请光临枫下论坛 rolia.net
Every time I looked on theese functions, I was totally lost; 1000 lines! By the time, I finished line 600, I probably forgot what line 200 is about.
When programmers modify something in module A; they have to go over all other modules to decide if they should do it on module B, C, D, E, F, and G?
At 1 point, I was so mad that I decided to do something about it. I discussed witht the architect and get his blessing to consolidated and optimized all the spaghetti code into just 1 single function. It took me 2 months and I discovered over 50 bugs. I managed to merged them into a function that has less than 40 lines. It is simple and readable.
Every programmer liked it; except.... the BOSS. During our monthly meeting, a programmer said I did great work on this function and asked when I was going to fix all other functions.
My boss called me into his office and complained that I wasted all my time that contributed no added value to the system. I told him that I had discussed with other senior developers and get the green light from our architect. I even showed him how many bug was discovered in this function for the last 2 years and during the 2 months that I optimized it. He still insisted it was a total waste of my time.
I eventually left the company. Before I left the company, I did a very simple predictive model. I did a regression on the time that was spend on fixing the bug vs. number of line in our system and also correlated to how many line we added to the system every month. And my prediction was that within 2 years, they would spend 50%+ of their time fixing bug.
I was wrong! Someone called me just about a years later that their boss was very upset and mad in a monthly meeting because they spend over 50% of their time fixing the bugs!
BTW, anyone see a jumbo class that has over 1000 variables!更多精彩文章及讨论,请光临枫下论坛 rolia.net