Besides, it’s kind of fun, said David Feder, a registered dietitian in Chicago and an executive editor of Prepared Foods magazine. He and his wife, the comedian Kat Herskovic, went to a Whole Foods Market with a sealed envelope containing their lab results, and asked for a gender-reveal cake. They opened the box to discover together, without a party, that they would be having a son.

“What is wrong with these people?” Mr. Feder said of the cakes’ critics, whom he likened to people who give out granola bars instead of candy on Halloween. “It’s just pure joy,” he said. “Why wouldn’t anyone want the maximum amount of joy?”

For a final word, here is Rose Levy Beranbaum, the exacting author of “The Cake Bible” and several other baking books. Now 75, she has made more than 100 wedding cakes, and is not afraid to fight off gimmicks. Someone once asked her to make a cake in the shape of a cockroach to hang from the ceiling so guests could take bites from it. She refused.

“I think you should have some respect for cake,” she said.

Still, she takes a softer stand on gender-reveal cakes — even though she had never heard of a gender-reveal cake until a reporter inquired.

“I’m really a classicist,” she said. “I’m about things that are here to last and that are delicious. So if there’s a way to do it so it would be good to eat, why not? It’s yet another way to present a cake.”

Alain Delaquérière contributed research.