Whenever I got hit by a teacher, it was always at their angriest moment. I didn't learn anything, resented them and myself more, and I often didn't know what I did wrong. I've had moments where I felt bad about missing an assignment, misbehaving, etc, and learned from it, but not from a physical punishment.

My mom has been a teacher for decades, frequently bumping into students (halfway across the world) who have families of their own now, and still thank her for being their teacher. She never lay a hand, and was successful in teaching thousands of kids difficult subjects in their formative years.

I have never been hit as a child by my parents, but I respected them, and feared their anger (even though I always knew they'd never hit me and always love me). I have used the example of my own childhood to prove to myself that corporal punishment is a needless tool. Physical pain should not be associated with failure, nothing should....except maybe consensual sex