I am currently working as a newly assigned lead developer (just in name, not really leading anything) on the frontend code for a project which my employer wants to deliver to various clients.
Unfortunately, the code has been written by a backend developer (inexperienced frontend developer). It combines some of the worst practices and the coupling is horrible. Working with the code and architecture is a pure horror but they have a deadline. I literally told them it's not possible to deliver with this horrible code base. It also somewhat mixes business data with styling. Not to mention the product looks really bad.
Well, they weren't happy and think the code is just fine. As a countermeasure I made a proof of concept in my free time and showed them how clean and modular code can be, especially with data binding (React), state management, etc. with a fast and nice looking UI. I literally recreated it with 80% of all the required functionality in only 2 days, including unit tests but totally maintainable. There was no positive reaction because they thought it was rude. In fact, they told me I need to adjust to the team. Focus on the deadline. I told them it can't be reached. I told them the code base has been written by this one person and since they have given me the lead, I'm giving my opinion, which I strongly believe is true. However, the guy who programmed this code is busy in a different project.
In the end, I need to work with this code and well, there is a saying: garbage in, garbage out. I'm still not done for things that should have been easy to do. Deadline could not be met. Now we have a new deadline.
What exactly should I do? I could easily solve the problem rewriting all this garbage in 5 days, which would even include unit tests but I'm not allowed to, due to the upcoming deadline and the belief that the code is "working" and that it would be a waste of time and money to write professional code.
The problem? Most colleagues say it's fine because apparently they respect the guy who wrote the code who is a senior Backend Dev. How can hundreds of "if" statements and nested "if" statements be good? Crazy handling of props. No state management. Custom event bus in a Vue app instead of reactivity? Hard coupling? Side effects? What about DRY principles? I'm seriously losing my mind.
What exactly am I going to do if I can't meet the deadline? They expect me to be able to work with other people's code BUT this code is truly apocalyptic and the more we build on it, the more it will establish as a product.