I joined a company to help add some functionality to their code. The code is legacy and has been terribly maintained. The technology is ~15 years old.
It takes days to track down bugs and problems that should take minutes, due to broken/missing logging and so much untested and spaghetti code.
Because of this is seemed logical to me to rewrite some of it, namely the parts that have no logging or error handling, that are incredibly difficult to read and cannot be tested locally on the development machines due to their hard-coupling with external services.
It isn't a complex system, and I am not rewriting all of it. I am extremely aware of the desire for new developers to come in and wipe out working code and replace it, but the code here is really bad, and really old (.net 2/3.5, no DI, no unit tests, no SOLID, using COM rather than microservices). I should also emphasise, that this is code that is undergoing change daily and causing errors and bugs daily, rather than legacy code no-one has need to touch.
I have rewritten the main engine causing grief using all of the latest techniques. Management agreed that this needed to be done at some point, but as I'm in downtime, I did it now. It serves as a proof of concept/documentation. I've kept them informed of my progress and they're happy with it.
I'm an accomplished software architect and it was a breeze. The new code is fully unit testable with dependency injection and comprehensive logging, so any bugs and problems are super easy to track down. Deploying this code is simply a right click > publish job instead of 1-2 hours of manually copying DLLS, registering COM components, fiddling with the GAC etc like the old code involved.
Whenever we fixed a bug before we'd have to wait weeks to be able to deploy it to our test environment to allow deploying multiple things at once to save time.
I should also add that the code is much simpler, easier to read, bits of functionality are contained within their own areas so it's not a case of making it crazy complicated that only some kind of savant can understand - quite the opposite, it's now modular instead of monolithic.
This rewrite was also be required in the near future due to moving to the cloud which doesn't support much of the ancient stuff.
Onto the problem - there is one developer who is extremely resistant to this change. He was the main developer previously. His ability level is average but he has done nothing to improve the previous code over the past several years, it is a case of broken window theory combined with no understanding of SOLID principles. He has also started working less and less and does not seem to contribute much anymore even though his only job is on this project.
The problem is, that in the meetings he outwardly speaks against my changes and will derail them, without good reason. He believes that as the current system works, it shouldn't be changed and that taking 1-2 hours every time we want to deploy to our testing environment is not too bad, or spending 1-2 days tracking down tiny bugs like a client missing a field on a web service call is just normal when it's the kind of thing that should take 30 seconds to resolve by examining the log files.
While porting some of the code I have also found a lot of bugs that I fixed along the way that should have been avoided but couldn't be as there is no way to write tests for the old code, nor is there proper error handling/logging. All signs point to the move being a good idea. I'm referring to literal bugs like possible null reference exceptions or forgetting to save the database after editing it, not to incorrect business logic.
I believe he is resistant because it will push him out of his comfort zone. He immediately spoke out initially before I even explained my reasoning.
The issue is that management look at both of us and doesn't know who to believe.
Any competent software engineer would look at the legacy code and immediately agree that it is unmaintainable and that hours of work are being sunk into debugging. They would agree the new code is clean, maintainable, adheres to SOLID and solves these problems while the old code is a mess and often has just giant methods that do all kinds of work.
What I need to do is explain that I have significantly more experience and have done this kind of work in the past with stellar results (I wrote all the code for a startup exactly as I have done here, and they are still using it 6 years later going from just me as the only developer to a team of 40+ people).
I'm also getting bogged down with having to write a lot of 'documentation' explaining why this new architecture is better, but it's entirely technical (talking about SOLID, unit testing, dependency injection etc) so there's not really any point as management will not understand it. Only the troublesome developer would understand, but he already understands, he is just trying to put pressure on me to derail it by creating extra work for me.
There is another developer as well who is 100% in agreement with me on everything, which helps a little. But he is less experienced, so it's a case of me architecting and him following along so he understands and is able to work on it too.
I am looking for advice on what to do about the guy. The ideal goal is that management sees the huge benefits this will bring, recognise that I am a very competent software engineer (not for vanity reasons but because I need them to trust me), and work to prevent this project being derailed.
I guess I should also emphasise that the majority of the work is completed making a proof of concept (which is really, a near-finished product - there wasn't a huge amount to rewrite and I work fast). There is downtime at the moment between project phases and so I figured I'd just write it while I had nothing to do. My only task was to document how I think we should proceed, and I was given 2 weeks to do that, but in 2 weeks I figured I could just build the new system and give the prototype as my documentation (along with a supporting architecture explanation), so I did. Everyone is happy with that including management, I haven't done anything clandestine.
I've edited my post to try and clarify the problem is with this developer because people jumped on the fact I was rewriting legacy code and assumed I was wrong for doing so. I also appreciate it is hard not to sound conceited when I say I've made everything better, but in this case, it really was bad. I'm not an amazing programmer but it isn't difficult to improve something that was this terrible.