Also, think longer-term: if you can program well enough, then you can write great software quickly which is a huge asset when making your own thing and selling it.
It is quite rational to optimize for your own wellbeing in these ways even in orgs that are not fully conducive to long term careers.
For so many reasons, from a mentor of mine:
Quality Is It's Own Excuse.
If you can do it better, do it better.
No? Doing things the right, robust way regularly takes more time and effort than doing it the quick and dirty way, which means your lazy coworker gets the management attention and raise instead of you.
For the vast majority of software developers, the correct career choice is just to always be making your manager's life easier, and they rarely care about "doing things the right way", especially when whatever you write will be replaced in five years because someone somewhere is too lazy to understand the current codebase.
Life is too short to spend most of your waking hours surrounded by people whose beliefs go against yours.
Not if you make a habit of it. If you do, the right way feels like the only way and comes quite fluidly. Meanwhile, the lack of PR bickering and regressions that point back to you does actually become apparent to your colleagues. Your work is not only quick, but good, and people notice both.
This is something that’s not apparent early in one’s career and the temptation to take shortcuts does have short-term payoffs during that phase. But if you stick to doing good work, you come out way ahead later on.
Be careful: it can be dangerous to tie your inner satisfaction with your work, which is not under your full control and also what you need to get paid. You can get burnt out.
Sometimes you have to take a step back and say "It is what it is, we all need money, fuck it and let's move ahead."