This is normally a "parp" subject for me - as it probably is for many mums (and I know I am nor alone) - as I will get lynched for what I relate of my own experince and beliefs, but I am going to do so in support of Matildax, Singingmum and Margo1974.
I have smacked ds, not in anger - and feel no guilt in having done so.
Now to clarify: by "smack", I define that as a tap, yes, a tap on the hand. it didn't leave a mark (I've tested just now on myself) and its purpose was not to hurt (which it didn't) but to shock - which it did - and so stopped the behaviour that occasioned it. I did it fewer than 5 times in total - and I can't even remember waht they were for as they were so rare and it was so long ago, as ds is now 6. I was also always very consciouos of not even thinking of doing it if I were angry. These events happened when he was around 2 and wasn't amenable to being reasoned with and on occasion, a short sharp shock was the most appropriate course of action - the quickest way to move beyond some impasse and get on with doing something else more enjoyable. I didn't have to "up the ante" as I didn't use it in those sorts of circumstances.
by the same token, in situations of danger, I also beleive it can be the approproaite course of action. yes, I agree with Xenia that lifting a child out of the danger would be the best course of action - but yuo may not have a free hand to do so and if speed is required, the smack and resultant shock might be the quickest.
At the same age (it all fades in the memory! ;)) we did also use "time outs" (and still do) - sending him out to the hallway. I can assure you that those occasions were far more distressing at the time to ds that the few smacks he was given.
Ds is now 6 and for a number of years this has not been - and will not be - a course of action that I would use, as I can now reason with him and have other forms of sanction available to me (althuogh I have to admit, when I was shouting at him this morning when he was refusing to get dressed at the swiming pool, my patience was being tired...... ) (he's normally soooooo well behaved! )
If I had been able to have another child, I would probably still use the same strategies.