In his 1964 book Games People Play, psychiatrist Eric Berne describes what he calls the “Yes, but” communication pattern: First, one person states a problem. Next, another person responds by offering suggestions on how to solve it. The first then says, “Yes, but …” and proceeds to shoot down any solutions offered.

“Because [problem-solving] is not the purpose of the exchange,” Berne writes. “Its purpose is to allow the subject to gain sympathy from others in his inadequacy to meet the situation.” There’s even a name for this type of person in psychology circles: the “help-rejecting complainers.”

But research has shown that complaining, when done right, can also have its psychological advantages.

“Complaining allows us to achieve desired outcomes such as sympathy and attention,” says Robin Kowalski, a psychology professor at Clemson University. “The truth is, everybody does it.”

A recent study, published by Kowalski and her colleagues in the Journal of Social Psychology, examined relationships between mindfulness (focusing one’s attention on the present moment), happiness, and expressions of annoyance. The study participants, 410 male and female college students, listed the pet peeves they had with a current or former relationship partner. They also completed a questionnaire to measure their happiness, positive and negative affect, depression, mindfulness, relationship satisfaction, and overall life satisfaction. Those who complained with the hope of achieving a certain result, the study found, tended to be happier than those who simply did so for its own sake.

According to Kowalski, there is a positive relationship between happiness and mindfulness, or the ability to focus on one’s thoughts and emotions in the present moment. She cites a 2006 study that found that approximately 40 percent of happiness may be determined by intentional activities, like consciously adopting an optimistic attitude and seeking out new adventures.

Like happiness, mindfulness is connected to a sense of deliberateness—more mindful people tend to be more aware of how their current actions can affect future outcomes. Kowalski postulates in her pet peeves study that happier, more mindful individuals may be better at modulating their complaints, preferring to complain only when it serves a purpose. By contrast, she says, people who are less mindful may complain more often, but to lesser effect.

“That’s part of the strategic nature of complaining,” Kowalski says. “It’s all about making the best choice, knowing when to complain and to whom.” The most effective type of complaining, she says, takes place when the complainer uses facts and logic, knows what they want their desired outcome to be, and understands who has the authority to make it happen. In an earlier study, she found that people with high self-esteem complain more frequently, possibly because those with more confidence are more likely to believe that speaking up will turn things in their favor.

But complaints don’t necessarily need to achieve results in order to be beneficial—one of the most common reasons people complain is for catharsis or emotional release, something especially true for those who have experienced a trauma in their lives. According to James Pennebaker, a social psychologist at the University of Texas who studies the use of writing as a therapeutic tool, when survivors of a traumatic event finally put their feelings on the page, they experienced improvements in their mental and physical well-being. Writing, he says, helps focus and organize the experience, resulting in a greater understanding of what happened and how to cope with it.

Other people complain as a means of crafting or reinforcing their identities; they use their complaints, in other words, to manipulate how others may see them, a phenomenon psychologists call “impression management.” Saying that the restaurant’s wine selection is under par, for example, won’t have any effect on the menu, but it will let others know that the complainer has high standards.

Kowalski and her colleagues have also examined the relationship between complaining and the group of traits that psychologists call the “Big Five”: extroversion, openness, neuroticism, agreeableness, and conscientiousness. In one study, the researchers gave subjects a personality test to measure the five traits, and then compared those results to participants’ scores on the Complaining Propensity Scale, a tool Kowalski designed to indicate how often a person is likely to express dissatisfaction. The researchers found, perhaps unsurprisingly, that the most significant correlation was with agreeableness; the more agreeable a person, the less likely they were to complain.

But when it comes to physical and mental health, a tendency to hold in complaints may have negative repercussions, explains Barbara Held, a psychology professor at Bowdoin College. “It’s important to learn how to tell friends and family when you’re upset,” she says. “If you don’t, you end up alone in your pain.” As Pennebaker noted in his therapeutic-writing study, past research has found that suppressing thoughts and feelings is associated with long-term stress and associated health problems.

In some cases, then, complaining can actually be healthy. “So much of happiness is intentional,” Kowalski says. “We’re not born happy, but we can actively engage in activities that make us feel good.” Similarly, she says, a complaint can be a means of control:  “A positive outcome is more up to you than you may think.”