The situation: My colleague (let's call him Joe) and I are department heads at a small startup (different departments). I have a lot more experience in my area. We are friends, and we work closely together, but lately have been having some pretty heated arguments, and I feel really bad about it since this is a tight-knit company and this is disruptive for everyone. I want to figure out how to avoid getting into arguments and help resolve the issues in a more productive way.
Examples of the things that started the last few arguments:
Joe questions technical decision that I made (that he doesn't at the time have enough background to understand the reasons for) in front of the whole team. Now I'm pretty clear on the difference between a "why would you do something so stupid" kind of question and a question that comes from genuine curiosity, and this definitely wasn't curiosity.
Joe says that it is "unacceptable" that a deliverable from my department will not be ready when planned, when the head of the company has just directed us to shelve that temporarily and work on something else.
Joe questions details of a workflow in my department (which he has never seen before) in front of junior colleagues.
The cherry: Joe directly tells me what to do, "you're going to have to do X" (that is after I had explained why this is not a good idea).
I know I don't react well in situations like this. I typically respond by stating my reasoning, but emotionally I am too keyed up because it feels like an attack, and the situation seems to escalate from both sides from there, so we're talking high voices and over each other (and it pretty much doesn't matter what we say at that point). Also, for some of these questions I can't lay out a perfectly reasoned and convincing answer on the spot, especially after I've gotten upset (of course I could lay out a very thoughtful and reasoned answer given an hour and in email).
The part that really hurts is that we are friends, and that the company is trying to do something important that we all strongly care about: I'd think we would be able to not get into petty interpersonal issues like this.
I'd like to figure out some ways to not get drawn in, react slower and more thoughtfully, defuse, deflect, instead of reacting fast and being seen as combative. I'd also like some ways to call out and discourage what I see as bad behavior and disrespect. How do I do it?