I work at an organisation with a very small dev department, developing a project with one co-worker only. We are both junior, never used ASP MVC .NET or worked on production grade code before. The others in the department don't have MVC experience either, and have never coded in a team, so they are no help.
I appreciate that my coworker has a strong drive to do things, but find that he does not think them through well enough. As soon as he has imagined a possible solution, he jumps to implement it, without taking a moment to reflect a) whether the solution fits the problem , b) if the solution is good in itself, and 3) how will his code react if the state of the world is not what he expected it to be (simplest example: he never thinks of validating user input).
What happens is that he is ploughing through features, churning out tons of new code. But I think that the quality of his code is very low. Case in point: after returning from vacation, I found that he created about 50 new semi-hard routes, most of which could have been handled by the default MVC routing system without any need for configuration. I told him why I think this is a bad idea, but he was not convinced and I did not insist that he change it. Today, I spent hours trying to find out why my first simple attempt to use an exception filter fails, until I noticed that one of his superfluous routes is wrong and redirects my request long before the method which throws the exception is called.
I already talked with my project lead (who is also the manager responsible for our workgroup) about this situation, but she is accustomed to ugly, unmaintainable codebases, and does not see a problem, especially because she is impressed by the quantity of code he delivers, and finds it normal that he spends so much time playing whack-a-mole with bugs we accidentally find (his tests are no better than the rest of the code, if they exist). She suggested that, if he is doing something wrong, I should just teach him how to do it right.
For the concrete feature implementations we need, I cannot teach him how to do it right, because I don't know the MVC-specific solutions. If I research the solution of a feature of his worklist for a day, he spends the day implementing two other features in his own brittle way, and I get nothing from my worklist done. And as for teaching him to think of consequences and side effects before he jumps into action, this is even harder for me, it seems to be too deeply ingrained in his personality.
I don't know how I should handle the situation. 1) How do I help him to start writing better code? He is thankfully willing to listen to what I say, but I don't know what to tell him. And 2) What do I do about bad code he has written which is not obviously buggy? I have no time to fix everything for him, or even to research the proper solution for him, but writing my own part of the code becomes increasingly complex and frustrating. He hates revising something he sees no problem with, and is unlikely to come up with a better solution the second time. Any ideas?