Complaining is bad for your mood, your brain, your listener, and even your body, according to a boatload of scientific research. So why do people do it anyway?

We're not masochists, obviously. Most of us love to moan occasionally because we think that " venting" to a friend or colleague will make us feel better. The idea is that by sharing your negative emotions with another, you'll not only lessen their impact, but also grow closer to your conversation partner in the process.

Study after study shows that while this seems to make sense, it almost always works the opposite way. Complaining primes us to see the negative in life, and conversations that dwell on what's wrong dig both parties deeper into misery.

But apparently, the conventional wisdom on complaining isn't 100 percent wrong. There is one specific type of venting that actually does what we hope it will do--bond us to friends and allies, and relieve a little emotional pressure.

How to vent right

That's according to research into a "co-rumination" conducted by psychologists and written up in Quartz recently. Co-rumination, as the term implies, is pretty much a fancy word for complaining together with others, a.k.a. venting. And as we've already discussed, extensive research literature shows it generally has nasty effects on mental health.

"Friends who spent time extensively discussing negative feelings reported destructive thought patterns and even depression. What's more, there was a contagion effect--not only did those divulging find themselves leaving discussions worse off, but their partners were also adversely effected," says Quartz of studies focused on adolescent girls (though apparently the same thing has been observed in other contexts, too).

There is a catch, however. While bitching and whining together can make the world seem bleaker, it does often bond us to those with whom we complain. "Most studies have found that co-rumination is present in--and essential to--most close relationships," notes Quartz. So is there any way to get the relationship-strengthening effects of a good moan but avoid the toxic fallout of too much complaining?

Don't brood. Reflect

Yup, says Margot Bastin of the University of Leuven in Belgium who studies complaining behavior. The trick, apparently, is to avoid "co-brooding" and engage in "co-reflection" instead.

"Co-brooding is the tendency to talk about problems in a passive way, wishing things had turned out differently and feelings of disappointment and dejection would simply go away. Co-brooders also tend to focus on all the potentially bad consequences of a particular problem, often predicting future catastrophe," Quartz says, explaining Bastin's work.

On the other hand, co-reflection "involves speculating about specific elements of a problem in order to gain a greater understanding of the situation. Using information gleaned from this process, individuals attempt to either seek a solution or prevent the negative event from occurring in the future."

In short, co-brooding is passive. Co-reflection is active and solution focused. And while brooding together is bad for both your mental state and your relationship, working through troubled times with co-reflection can be very beneficial indeed.

"If people are more focused on trying to grasp what's happened to gain insight, then it might actually be a very good thing," says Bastin.

So next time you feel the need to vent, just be cognizant of the distinction between brooding and reflecting. Complaining in general is pretty sure to make you feel worse, not better. That is, unless, you and your conversation partner are actively focused on finding solutions or learning from your troubles.

If so, then go ahead and moan. Science gives that particular form of bitching the thumbs-up.