I'm a software developer working in a small company. My tasks are to write code based on requirements passed from above. I've been working in similar jobs in the past and enjoyed them a lot, and have been doing unpaid overtime simply because working on code is fun for me.
However in my current job I feel highly unmotivated to write any code, and this has a significant negative impact on my performance. This has been going on for months and I'm trying to find a solution to fix my performance. I'm working as slow as 1/10 the speed that I did in the past, and cannot concentrate on writing code even during work hours.
The root cause of the problem is that I like writing professional grade code while keeping in mind both industry best practices as well as research with peers online and common sense. If I write good code that I'm proud of, I'm having fun, and I just keep doing it naturally.
In my previous jobs, my managers were "business people", and let me write code any way that I wanted. Although they did not understand what I did, they were consistently satisfied with the results (both the delivery speed and actual quality of product), and I was satisfied with the job itself.
However in the current job, my manager is a "technical person" who also likes writing code himself. He is much older than me. He has ancient code writing practices, writes untested undocumented code with lots of misc corner case bugs, uses print statements as debugging mechanism and commits those into production, has a weird manner of using git which is unlike any other place I've seen using version control, and generally creates code which is not up to par with modern industry standards.
His code is difficult to work with, which hurts delivery time, as a lot of time it spent on reading the code and trying to understand it (not just for me. he spent weeks debugging his own bugs because he forgot what his code does in certain parts due to ambiguous variable and function names and poor module design).
It also hurts the quality of the final product, due to not optimal solutions to problems, and various other product issues as a result of how the code was written such as limited configuration options or limited backwards compatibility options.
I've been trying to politely explain to him that using newer coding practices would be an overall improvement to the company, and trying to teach him how to write code himself in more modern ways. He tried to be nice and play along for a bit, but in the end he always ends up writing code with the same mindset he has of "quick and dirty".
He assumes his mindset leads to faster results (e.g. it's "quicker") because it takes him two days to write a feature I would spend four days working on, without taking into account that his two-day version is filled with bugs that he spends two weeks on debugging afterwards, and that we can't ship a buggy version, so ultimately his workflow is actually much slower. I'm not perfect and I end up having a bug in my code sometimes as well, but due to following modern practices, my bugs tend to be easy to tackle within the code and solve in a few minutes, they're usually small typos or forgetting a line and not a major logic flaw. However whenever he finds a bug in my code, he uses it as an example to justify that his workflow is faster because "there will always be bugs anyway", even if in practice 70% of the company's development time is spent on debugging bugs in code he wrote.
There were a few occasions where he permitted me to completely rewrite a module he wrote himself, which I did, and he even admitted himself that my version was much cleaner and easier to work with and looked more professional as well as fixed many bugs and improved performance, but as soon as he'd go back to work on that module himself the code quality would drop back to his own standards.
I feel like there's no point for me to write code because it will just be ruined afterwards. If I don't do it perfectly it will be used against me, if I take too long it will be used against me, and even if I do it right it will be brushed off and messed up later. I keep getting instructions from above to "just deal with it" or "just do your best". However I can't do my best. If I spot a critical flaw in the code and point it out, my manager may randomly tell me "it's not a big deal, don't waste time on this, work on something else". Even when that something else is directly affected by the flaw I found.
I'm not sure what to do at this point. Lately whenever I try to discuss optimizing our workflow with my manager it just becomes a long argument that ends with him saying "I was doing this for years and it worked for me, so I refuse to change anything, and you'll have to deal with it" in one way or another.
I'm asking myself what my options are, because under-performing at work stresses me out and gives me headaches outside of work and reduces my life quality in general. I've considered:
- giving my resignation and finding a new job (note: my boss will have a hard time replacing me for the current position I'm in)
- rebelling and doing code changes I was not permitted to do if I feel like I know better (will definitely lead to conflict and other types of headache)
- continue as is, do my hours and get my pay with minimum effort, don't get emotionally attached to code at work and focus on personal code projects on my free time instead (gives me headache right now due to frustration)
All of the options I considered feel like they would be hostile towards the company and my manager. Outside of our technical disagreements, he is a nice person and I wish him well. Are there any other options I'm missing, or, what can I do to regain motivation under the existing circumstances?
[Edit] The answers submitted so far suggest to quit the job. I'm keeping this question open because I'm interested to see if there would be any answers that would recommend to keep it.