I rarely lose my temper in class for the same reason I won't spank my kids. (Full disclosure: I don't have kids.)
For the slightly imaginative teachers/parents among us, there are endless ways to mess with kids' heads and make them want to want what we want for them. They're endless. There are positive reinforcers, negative punishments, negative reinforcers, positive punishments, and lots of gray in between.
I've always assigned kids time after class if they talk when I need quiet. I always will. It's easy, cost-effective discipline. This one time, while student teaching, a student decided not to stay for his detention. He slinked to the door while I talked to his buddy. I looked up. He bolted out the door. Dumbass teacher that I was, I ran after him outside and yelled at him to come back. Of course he didn't and I looked like a dumbass to every student within earshot.
The next year, and every year after, I let them run out the door. Then I walk to the board, write their names down, and make a note to double their time the next day.
If they don't serve that, they get a 15-min. detention after school.
If they don't serve that, they get an administrative detention.
If they don't serve that, they get a Saturday School.
If they don't serve that, they get an administrative suspension
If they don't serve that, they're one strike closer to expulsion.
Point being, if the system (parenting or teaching) is set up thoughtfully and fairly, there's never any need or point to losing your temper or spanking your kids.
Charges of naiveté and presumption, especially coming from parents, are probably warranted.