Last month, the federal government proposed new rules regulating the types of foods that can be served at schools, mandating more fruits, vegetables and whole grains and less sodium, saturated fat and trans fats.
The new standards would be phased in beginning July 1, but only apply to food sold in cafeterias and vending machines.
Classroom snacks, incentive prizes and the goodies parents provide for holidays and birthdays are at the discretion of individual school districts, and there are very different rules among school boards about how to handle them.
In the Norris and Greenfield school districts, for instance, there's a formal policy against sweets in the class.
"We don't want them," said Norris School District Superintendent Steve Shelton.
Norris has three officially sanctioned times for parties -- the last day of school before winter and spring breaks and at the end of the school year.
"There was a time when people were bringing treats for every birthday and Valentine's Day and Halloween and all that, but then it's just constant," Shelton said. "We also don't want to take away from instruction time."
Norris wants its students' noses in books, not cupcakes.
But some parents say it's unfair to withhold goodies from children who aren't sick or overweight.
Erica Miller, 20, is a mother of two who brings cupcakes and other treats to her oldest child's preschool for birthdays and holidays.
"Honestly, if they have a couple sweets or snacks at school, it doesn't bother me because they're kids. They should be able to enjoy a few sweets if they like," she said.
If a child is ill or overweight, it should be the parent and that child's doctor who restrict the child's diet, not the government or school administrators, Miller said.
"People are just too obsessed over silly little things like weight," she said. "I don't feel like we should discipline all the other children over one child's health problems."
The Panama-Buena Vista and Fruitvale school districts don't have policies on sweets in classrooms, although they do informally urge teachers and parents to prioritize healthy snacks over junk food.
"We've really tried to move away from that, just in the interest of wellness," said Fruitvale School District Superintendent Mary Westenddorf.
Fruitvale is sending its school nurses to an obesity conference next month, and may "standardize that policy" based on what it learns there, Westenddorf said.
Even in districts that are trying to clamp down on classroom junk food, it can be difficult to reverse a deeply ingrained culture of cookies and candy for special occasions, or even on a daily basis for routine afternoon snacks.
"I've been on campuses and I walk in and see teachers giving this stuff out," said Greenfield Superintendent Chris Crawford. "I don't say anything at the time because we don't want to embarrass them in front of their classes, but I'll go later and ask the principal to please remind them privately."
Schools have their work cut out for them.
Nationally over the last 30 years, obesity rates among children have doubled, and they've tripled among adolescents.
That has long-term health consequences that are especially acute in Kern County.
More people die from heart disease in Kern than any other county in California, and Kern is the second worst county in the state for deaths related to diabetes. Six of every 10 residents here are overweight or obese.
Children are particularly vulnerable to the perils of poor eating habits because when they fill up on junk food, they don't have room for healthy, balanced meals with the nutrients their growing bodies need, experts warn.
"We are struggling in our culture to get parents to promote healthy eating at home," said Bakersfield Memorial Hospital dietician Laurie Wallace. "To have teachers work against them I don't think is healthy for our children or society."
Parent Steve Walsh said he wishes his children, ages 6 and 7, could have fruits and vegetables at classroom parties instead of the candy and pastries that show up at certain times of year.
"If they were getting that at school, they'd be more likely to choose fruits and vegetables at home," he said.
The California Department of Education has grant money available to pay for fresh produce in the classroom in addition to school cafeterias, said spokeswoman Tina Jung.
"We really encourage that because not only is it healthier, but then you have the added bonus of helping our local farmers, so it's good for the economy," she said.
Some parents are particularly frustrated by the practice of using candy and other treats as an incentive or reward.
It's a common practice because teachers often are paying for the rewards out of their own pocket, and it doesn't cost a lot to buy candy in large quantities.
But using it is bad for a variety of reasons, said San Joaquin Hospital dietician Kira Wiggins.
"Adults who have trouble controlling their eating often learned as children that we celebrate something good with a sweet treat," she said. "The reverse of that is when you're feeling bad, you eat a sweet treat to make yourself feel better.
"So if you're eating a sweet treat when you feel good, and also when you feel bad, when are you not eating a sweet treat?"
Heather Guffey uses candy to reward good behavior among the autistic students she teaches at Stockdale Elementary School.
She doles it out in limited amounts, maybe an M&M or two, or one small piece of Laffy Taffy.
"In my world, it's called primary reinforcement," Guffey said. "It works. It works really well. But I use it sparingly because it's a very powerful tool."
Guffey is concerned about both childhood obesity and the addictive qualities of sugar. Craving sweets and eating them habitually can be even more of an issue for an autistic class than for a mainstream classroom, she said.
Teachers in the Bakersfield City School District aren't allowed to use sweets for prizes.
BCSD teachers use non-edible items when they want to reward a child for a job well done.
That's just as effective, said Casa Loma Elementary School kindergarten teacher Anita Madden.
She gives her students points for behaving well or achieving a given task, and subtracts points to discourage mischief. The points can be used eventually to "buy" things like chalk, bubbles or time playing a fun learning game.
"They really like that," Madden said.
John C. Fremont Elementary School kindergarten teacher Korrin Loo promotes homework and attendance with school supplies or small trinkets and toys that she buys with her own money.
"That's really exciting for a small child," she said.
For snack time, the children in Loo's class eat fruit or some other food besides candy.
But even Loo finds the ban on treats a little dubious.
"Me giving a child a couple of M&Ms is not a part of the childhood obesity problem, in my opinion," she said. "Good eating habits come from home."