Look, who among us hasn't approached the Shake Shack counter and ordered a double-patty cheeseburger with bacon and a side of cheese fries, only to then request a diet soda to ridiculously accompany such caloric behemoths?

So, no judgment here. But you're doing it wrong.

Adults who drink diet beverages tend to compensate by eating more unhealthy, nutrient-poor foods, according to a study published Friday in the Journal of the Academy of Nutrition and Dietetics.

And the habit is pretty self-defeating.

"When people consume diet beverages, they need to be more cautious about consuming additional calories from discretionary foods, because that will completely undo the weight-control purpose," said Ruopeng An, the study's lead author and University of Illinois kinesiology and community health professor.

Researchers analyzed a trove of data collected from 22,513 adults between 2003 and 2012. Study participants noted every little thing they ate and drank during two, nonconsecutive days. Drinks were divided into five categories: coffee, alcohol, tea, sugar-sweetened beverages (such as sodas and sports, energy and fruit drinks) and the low- or no-calorie counterparts to those sugary beverages.

The study also looked at people's consumption of "discretionary foods," which are categorized as such "because people are enjoying them only for leisure and not the main element for human nutrition," An said. This 661-item list of foods that are low in nutrients and high in saturated fat, sodium and sugar includes fries, cookies, pastries and biscuits.

Unsurprisingly, people's caloric intakes were higher on days when they drank high-calorie beverages. For instance, people on average consumed 384 more calories on days when they drank alcohol compared with when they didn't drink alcohol.

And though coffee and diet beverage consumption was associated with lower overall caloric intake, those drinks were associated with the largest increase of calories from unhealthy foods. Basically, you're eating more cheese fries and double-patty burgers on days when you're drinking diet sodas. Diet beverage drinkers consumed almost 50 more calories from discretionary foods; for coffee drinkers, it was 61 calories.

The coffee association might be because people tend to drink java with a snack, and that snack may more often than not fall into the bad discretionary category, An said. Overall, people consumed an average of 482 calories from discretionary foods daily, according to the study, and obese adults drinking diet beverages consumed more calories from unhealthy foods than their "normal weight" counterparts.

It's not quite clear what's at play. An said people could feel less guilty about their calorie choices when they opt for diet drinks, so they up their bad-food intake. That guilt could be working in reverse, as well -- bad food leads to diet drinks. Or diet beverages could leave people feeling less satisfied "so they tend to feel compelled to eat more high calorie foods," An said.

"We don't know what mechanism or mix of mechanisms is at work," he said. "But at least this gives us something to think about in terms of people's dietary behaviors."

An emphasized the need for people to consider everything they consume when trying to make healthier life choices. You aren't just what you eat; you're what you drink, too.