I started working at Dec 2018, currently, there is only me and the senior developer and we sit next to each other.
He comes to work really early and leaves early.
When I started working I noticed him really lecturing me about not touching his code.
Almost everyday when I come to work, I try to be at my best attitude and everyone at the office likes me and talks to every time, except him.
He becomes hostile every time there is something I want to ask him, that to him, seems like redundant question, just to clarify, my questions are related to HIS project that I have NEVER touched, BUT he somehow thinks I need to know every single bit of the code and tells me that I am stupid for asking and not figuring it out.
(And by the way, his code is so bad that all the variables are just bunch of random letters sometimes, never a whole word that describes it)
There were a lot of fighting like this and today something happened: yesterday I needed to finish a system I have been working on and when I ran the project, it crashed, so I started debugging and found out that he forgot to add a few lines to his code (the code that he didn't want me to touch).
It was 4-5 hours before end of work, I didn't really have anything else to do, and he kept me in the dark about what I should do next, and all the code is on his computer and he lets me have pieces of it every time I finish something...
So what I did is add 1 line of code (assignment) that he forgot, and continue finishing my work. (there was another thing he forgot but I didn't touch that because I knew he would go crazy)
Fast forward to today, I told him about what I did, showed him the line of code, he went silent. Just for the record, all the company sits in a long hallway and we can all hear each other and talk to each other (and see of course).
When he started talking he went yelling in front of everyone that he told me not to touch the code and it's the second time he tells me that, and I told him "ok I can delete it" and he again went quiet (and you could see his angry face clearly), I asked him if we can continue with the CR, he told me "I don't think I want to".
It was more yelling after that in front of everyone and I just got up and got into a empty room.
After that I got outside and a coworker came to me and told me about him that he is like that with everyone he worked with before, and every coworker that we have in the office is backing me up and I should be strong... I started crying because I couldn't help it.
I don't really know what to do, I already told the manager a week ago about all this and he didn't seem to do anything just told me that in two months or more we will be separated...
If I go and tell him again and he confronts him, he will be even more angry with me because I told the manager. And he is a greater asset than me for the company..
I really don't want to get fired because of that, and I don't know what to do.. If anyone could help me with this situation that would be great.
Edit: The manager just called me in, and told me about what happened and told me that what he said earlier about 2-3 month to separate us, will be even sooner (didn't specify a date).
He said that tomorrow he will talk to him about all that, and if I want I can take half day off or I can learn a new system they are integrating.
I don't know what will happen but you were right he told me he will work on it as soon as he can.
Thanks to everyone for the help I truly appreciate it!