The foods you eat and the dietary habits you follow have an affect on your brain and, therefore, your mental well-being. But age plays a role, too. A study in Nutritional Neuroscience lays out the different ways diet affects mental and emotional health depending on a person's age and brain development. What you need to eat for good mental health in your teens and twenties appears to be different from what you should eat when brain development ceases at around age 30.

Over 550 people from all over the world completed an anonymous Internet questionnaire containing questions about certain foods and their moods. The Binghamton University researchers also asked questions about food groups linked to brain chemistry.

What you need to eat for good mental health in your teens and twenties appears to be different from what you should eat when brain development ceases at around age 30.

Young adults' moods appeared linked to foods like meat that build-up serotonin and dopamine, two brain chemicals that are known to improve mood. Eating meat on a regular basis and regular exercise both helped keep these neurotransmitter levels at healthy levels. The study found that young adults — age 18 to 29 — who ate little meat and exercised less than three times a week showed more mental distress than those who ate meat and exercised more often.

The story was different among adults over the age of 30. In this group, mood and mental health seemed to depend on eating more foods that increased the intake of antioxidants and avoiding choices that could trigger a stress response, such as drinking coffee, eating high glycemic index foods and skipping breakfast.

Antioxidants are important for those over 30 because as people age, free radicals, formed when certain molecules interact with oxygen, increase. Unchecked by antioxidants, they can start a damaging chain of chemical reactions that affect cells' DNA or membranes, causing cells to function poorly or die.

And because aging reduces the body's ability to regulate stress, consuming foods like coffee or excessive carbohydrates that activate the stress response can have a bigger effect on mental distress.

So, it seems that moody teens and young adults could benefit from eating more meat and exercising regularly, while older adults should consider eating more antioxidant-rich foods, like fruit and berries, to protect their mental well-being.

Is there a difference in how diet or dietary practices affect men versus women? The research team plans to study that next and hopefully find an explanation for the differences in mental distress between men and women that have already been documented.