4 ms·
I was sort of in the same position as you about 18 years ago. But all the guys who wrote that code moved on, the managers moved on. I hanged on, kept refactori
by olvy0 4y ago
I was sort of in the same position as you about 18 years ago. But all the guys who wrote that code moved on, the managers moved on. I hanged on, kept refactoring and fixing bugs in the horrible code, often alone. Also supporting internal users. I got to the point where I was the only one who knew it all, so managers didn't argue me and essentially let me do what I wanted. I became the team's technical lead, while the team itself disbanded and reformed 3 times around me. The code is much better now, although there are many dark corners left.
It takes some grit, determination, some belief in yourself and your abilities, and some minimal level of laissez-faire attitude in your level of the organization to get going. In the beginning I had encountered opposition to my changes, but in retrospect it wasn't that strong and I was allowed to have a small impact even then.
If that's not the situation in your case then I think you'd best move on, it's not worth it. If you do want to stay, I'd try to befriend that older guy or at least work with him and have him recognize that you're good and you mean well for his code, so he'll not object to your changes.
BTW, at the end I sort of became that old man myself... But I strive to be a much better one than the ones who were there when I came aboard. Me and my team lead, who "grew" together with me in the company and shares the same views, encourage refactorings, unit tests, and proper documentation, clean code and code reviews. She deals heroically with the pressures from management and users to add features quickly so I wouldn't have to.
I accept criticisms of my code and the app in general, and always try to explain to critics that I think they're absolutely right but there was a serious cost/benefit anaylsis done behind each bug or duplication that was knowingly left in the code from the old days. They are being dealt with, just very slowly and carefully. Like you, I still get a headache looking at the old pieces of the code which remain from that era, but they have been mostly phased out by now and next year I hope will be deleted completely.