I have three children. I spanked them as the nuclear option when it was important to get across the idea that they could never, ever do whatever it was they did again. Generally the threat of a spanking (I did the silent countdown on my fingers until they self-corrected) was enough. The younger ones learned impulse control fairly early. The oldest one practiced bad behavior IDIC (Infinite Diversity in Infinite Combinations) so his spanking encounters were more frequent. Correcting that kid's behavior was like playing Whac-a-mole.
My mother spanked me (she had a belt dedicated to that purpose). It worked for me.