What helps me at work is having a coworker that has a desk in the same office, and we encrypted chat back and forth. Seems like every day, one of the freelancers that our company uses to outsource menial coding, or the new guy that was hired above me but can't quite code for his life, will ask me to fix a bug in what they wrote, and often, I find that the whole thing is just completely and utterly nightmarish (as an aside, the last HTML document that the new guy wrote that I had to fix contained such oddities like a <textarea> tag with "width", "height", and "type" attributes set [to 20, 5, and "text", respectively]. Spoiler alert: that's not even close to valid or functional).
Just as bad as inheriting bad code is being ordered to write it, like my boss' infamous micromanaging of the UI design:
- He doesn't like the word "disapprove", because he doesn't want to give bad feelings. Fine, now it's called "unapprove", to strip a record of its approval.
- Okay, now he wants employees to request approval. Fine. So, if he likes it, he approves. If he doesn't, he... unapproves. They never had approval in the first place, though.
- Now, he wants a state where instead of just removing the request for approval if he unapproves, it is unambiguously marked that it has his disapproval so that they know to fix it. He wants it to be called... "On hold". So records are held when he disapproves.
- The point where I call it borked is when I find several records with "XXXX" in the field where the supervisor's initials go when they approve a record. I inquire, and it turns out that they put that there on approved records to mark that it is good, but not to use it yet, because the situation's unstable.
Hold on, hold on.
- When you undo an approval request, you "unapprove" the record that was never approved.
- When you disapprove, you put the record "on hold".
- When you want to put a record on hold, you "approve" it, then put "XXXX" in the initials.
Unfortunately, he ranks so high in the company that he can literally send me packing on a whim, and no one would question him. So, his insane notions go. And the codebase gets tainted more and more, as they request new features that are made practically impossible due to their decisions on how we'd do our jobs beforehand.
I'd slap a keyboard, too. What keeps me sane is having a laugh about it with a sympathetic co-worker, who frequently comes up with new ideas for the software (he's one of the foremost users), but they get labelled as stupid until a bastardized version of it is ordered for me to implement, without giving him any credit (back when it was still a good idea).
TL;DR: I hate my job, but co-workers caught in the same struggle are helpful.