I always tell myself to factor in intent when I detect myself starting to feel slighted. Did the other person mean to offend? Were they aware that the action was offensive? If the answer is no, then the usually recommended course of action is to let it pass, but be ready with a gentle, boundary-establishing statement to prevent further hurt the next time -- one that does not offend in itself.
When angry, it really feels good to just cut loose and let the other person have it. This is *never* worth the momentary satisfaction gained. First of all, how well do you know that other person, and what they are capable of in terms of retaliation? If they took one blow from you in the past, how many more will they take? Unfortunately, such things have a cumulative effect. If a person is mean one day and nice the next, the effect of the nasty behaviour does not fade over time, and reset everything to baseline. Eventually the recipient of said anger will take steps to protect themselves. These steps may include removing themselves from your presence (if enough people do this, one is left with no friends), vicious retaliation, or bringing down a third party on your head. Eventually, through repeated strikes, people get the measure of one's character, and respond accordingly.
Secondly, what kind of world is it that we want to live in? Both courtesy and rage are contagious. It's not right for us to bring negative energy into the world. We do have to take responsibility for our actions, because we each have to live in the atmosphere we surround ourselves with.
Third, we never know where "news" of our behaviour will go, or how far reaching the consequences can be. Maybe the person we just mouthed off to is the favoured nephew of the boss, or has the ear of your boyfriend's mother. One never does know.
In a matter of seconds, a few harsh words can do irreparable damage and cost one more than is initially realised. Not everyone is strong enough to forgive a strike and take another (and another), because we are all entitled to protect ourselves in some way.