I have worked at a startup for 3 years alongside the CEO and another developer which I will refer to as Tom from this point forward.
Tom is 35 years older than me and is seen as the more experienced developer, which is a fair assessment to make since I was hired right after graduating college. However, Tom has no education in computer science (is mostly self-taught) and does not comply to many best practices when coding, designing databases, documenting etc.
Who cares, right?
Well, this combined with his personality makes working with him a real pain in the back. He is always defensive, offers little to no constructive criticism, does not communicate much and "always knows best".
Tom is very defensive of the code and refers to the current project as "his" even though we have worked on it for the same amount of time (only difference is a few of his libraries being imported at the start of the project). He does not seem to notice my contributions to the project and instead tend to be annoyed by them.
Whenever there is a discussion where we are on opposite sides (which happens a lot) I have to work tooth and nail to convince him that we should do things differently. He is often dismissive about these suggestions, even when I provide multiple examples of why it is the better approach. Whenever he runs out of arguments for his side he gives up and passively aggressively says something in the lines of "Do whatever you want! I don't care!", and that is the end of the discussion...
Tom gets upset whenever I make changes to the code because he "can't keep up". Mind you that these are changes that we have either discussed and agreed on beforehand or is a bug from a support case that needed fixing ASAP. Tom makes changes to the code all the time and I keep up with all of his changes just fine. He does very little to understand my changes and just "rolls with it" even though I urge him to read the pull requests before merging.
The problem here is that I try to collaborate with Tom as much as I possibly can, yet he shows no interest in collaborating with me. I rarely get any feedback (positive or negative) on my work.
Because of all this I get very little work done. Any suggestion or change I make to the code is constantly frowned upon. I get frustrated over Tom's behavior and my CEO's inability to handle the situation. The CEO is supportive of my work and tends to side with me in discussions, but never calls Tom out on his erratic behavior.
I have lashed out a couple of times and discussed changes we would both benefit from multiple times, but have yet to see any improvement.
I get the feeling from Tom that he is terrified of being replaced. This has come up at a few occasions.
I understand this question is complex and not very concise, but I would like to find a balance where we could work together. It basically boils down to the questions below.
How do you work with someone that "always knows best"?
How do you work with a man that is afraid of being replaced?
How do you get someone to be less critical of someone else's suggestions?