At a time when nearly a third of Maryland children between ages 10 and 17 are either overweight or obese, you'd think there'd be a law against selling junk food and sugary drinks on school grounds. Wrong. While many in-school cafeterias in Maryland, including those in Baltimore City, are making a good-faith effort to put more nutritious foods on their menus — more fresh fruits and vegetables, fewer fatty burgers and fries — as long as kids can scarf down the less-healthful alternatives available in vending machines on the premises, the fight against childhood obesity will remain an uphill battle.

The insidious effect of school vending machines was highlighted last week in a report that compared childhood obesity rates in states with strong laws prohibiting the sale of sugary foods and drinks in schools and states without such laws. The researchers found that students in states with the toughest laws not only were less likely to be overweight or obese, but that even when they started out overweight they were more likely to eventually shed the extra pounds.

School dining rooms have come a long way since the days when the menu offerings were little more than tuna-on-white sandwiches, franks and burgers on a bun, starchy cheese casseroles and limp iceberg lettuce with French dressing. No wonder kids so often turned up their noses — if not out of disgust, then simply from sheer boredom. Who could blame them for preferring the oversweetened, over-salted junk food snacks sold in the vending machines just down the corridor?

Unfortunately, those preferences also help fuel an epidemic of obesity that puts millions of schoolchildren at risk. Over the last 20 years, obesity has doubled in Maryland and across the nation. Today, about 177,000 of the state's 615,000 adolescents are overweight or obese — 28.8 percent of the state's young people. Among African-American youth the problem is even worse, with 34.6 percent of kids carrying around too much extra weight.

Obesity in childhood is not just a problem of cosmetics or adolescent self-esteem, though it obviously has an influence on both. Children who are overweight or obese as youngsters are more likely be to be obese as adults, putting them at greater risk for various serious adult illnesses, including heart disease, stroke, type 2 diabetes, some forms of cancer and osteoarthritis. The health costs of caring for patients with these diseases came to some $27 billion last year, more than a quarter of the nation's total health care bill.

No one is denying that a great many factors influence a child's weight growing up. Youth advocates in Maryland say that in addition to improving school lunches, the state needs to promote more physical exercise in schools, improve access to healthier foods in poor neighborhoods, encourage families to limit the hours children spend watching TV and increase their access to parks and recreational facilities. There's no single magic bullet to instantly make kids lean and healthy.

But banning vending machines that sell bad food in schools ought to be a no-brainer. Granted, the law is a blunt instrument for shaping public policy, and no doubt some kids — and their parents — will always complain that the "nanny state" is crimping their style by taking away their freedom to double down on butterscotch crumpets and Ho-Hos at school.

There are plenty of healthier choices educators can make available, however, including products offered by vending companies that specialize in organically grown fruits, cheeses and nut snacks that are low in calories and high in nutritional value. Maryland's lawmakers can't force people to eat them, of course, but they can certainly raise the bar on the quality of comestibles that are available in schools, and they should, because right now what too many Maryland students are putting into their mouths is a scandal and a shame.