I find it's partly a cultural thing. In Italy, from what I've seen, people have no qualms about shouting at other adults in public.
In this country, it is accepted and common to shout at children in public, but not (usually) at adults. People who yell at their partner in a supermarket get funny looks and may be asked to leave.
In Sweden, shouting at your child is seen as similar to shouting at an adult; people are embarrassed about it, so it's something you rarely hear on the streets.
I can sympathise with parents who smack their child in the heat of the moment- but I feel torn two ways on this one. After all, what would we say about a man who admitted to smacking his wife because she made him lose control? Or are we pretending that partners can't be as infuriating as children? I can see the argument for not treating a child as the equal of an adult- because we know more than them and it is our responsibility to bring them up. But once we are admitting to losing control to the extent of doing things we really don't believe in- doesn't that argument go out the window? How come we lose control with our children and not with our bosses and spouses? Let's face it, it's not for very admirable reasons.
I don't want to lay guilt on anyone who has done something they regret, because heaven knows parenting is a hard enough job without the guilt. Still, I sometimes do think you can be proactive and avoid a lot of hassle. Simple things, like starting an interesting conversation the moment before you enter the supermarket/get on the bus, holding the hand of a toddler in a shopping centre or even using reins.
I didn't find singing good for actually communicating with the children (too difficult to keep a straight face), but invaluable during the buildup to boiling point, to drown out the sound of my mounting frustration. I sang a lot during the early years, and not always because I was happy.
I have shouted on occasion (oh yes, I have!!!), but not really in public: I have always been keen to teach my children that we have to be extra considerate when other people are around who don't know us, and that goes for me as much as for them. If they don't copy that from me, they'll never learn it, and I do think it's an important lesson to learn. It's not about being a hypocrite, it's about not imposing on other people. Shouting always sounds much worse from a complete stranger and personally I hate the thought of a bus journey punctuated by loud screams from strange women.
But I do find that being forced to hold myself in in public makes me think of strategies that are then useful in the home.