As the mother of three boys, I have found that my own self-restraint, willingness to apologize, honesty, consistency, and love have been examples that my sons have chosen for their behavior toward me and others -- as they've gotten older. That being said, my sons all have dramatically different personalities. The same method of getting their attention has not worked for all of them all the time. The older two are cerebral, quiet and reserved. The youngest came into the world with testosterone and attitude, and a desire to control his environment. He has been a challenge, and there have been times when a loud voice or physical contact was a surprise, an attention-getter, and was effective abruptly stopping an action where he may have harmed himself or others. In public, people may think you shout at your child all the time; too bad, at least he didn't run into the parking lot and get hit by that car. When actions did not meet clearly stated objectives, I would hold onto an earlobe, gently, because my holding the earlobe was adequate: the boy would settle down, slow down, pay attention to what I was saying, and when we agreed on acceptable behavior, was released. They were in control of how much discomfort they had, they could control their actions, because if they did not, their own actions made them uncomfortable. I rarely had to use this tactic twice in one day, or even one week, but it was effective.
As for a swat on the backside, that was a tactic that brought out quiet defiance in me as a child, I refused to cry. I didn't consider it a great tool, and rarely resorted to it, and certainly never when I was frustrated, because it would only demonstrate that I had lost control of the situation. The only time I remember using it, was when I was driving a two-lane highway in extremely heavy fog one morning. The youngest, who was three and did not want the humiliation of a car seat (I KID YOU NOT he has always thought of himself as a fully grown man, and at fourteen finally realizes he is not) learned to unbuckle himself, and got out of the middle seat of the van (so positioned to isolate him from his two older brothers), went to the back seat and began punching his brothers. (Not all children learn this from abuse, some children are wired this way; his brothers have always been gentle.) I pulled to the side, put him back in the carseat, told him he had to stay in his seat, and drove about fifty feet, and he was out punching them again. I pulled to the side, cars flying by, and paddled him, told him he was paddled for hurting his brothers, and not obeying me, and not being safe, and put him back in the carseat. I drove fifty feet and he was out again. This time, although against state law, I put him in a seatbelt, and drove off without another incident. My rationale was that i could not continue to endanger the entire family by stopping at the side of the road in heavy fog. The 'spanking' didn't work. Addressing the child's issue, although not a winner for law and order, kept him in the seat for the rest of the trip which did not endanger the family, did not continue the abuse of his brothers, did not distract me from driving in terrible weather, and got us to our destination in one piece.
I don't like spanking, but that doesn't mean that physical discomfort is not an effective attention-getter, and behavior modifier. It doesn't have to be painful, and it can be a learning experience.