Absolutely yes.
Children don't rationalize like adults do and sometimes you simply needs to do things differently.
For example. I keep a 1.5-2ft 2x4 on the mantle with the word EDUCATION written on it and I call it the Board of Education. On the back of it is written reasons for it's use:
1) Lying
2) Stealing
3) Being somewhere without telling us where he is / where he's going
My boy knows that if he's ever caught doing either one of those, he is going to get a spanking. Now, every child lies. I know it, you know it, but I always give him the opportunity to come clean first. We are constantly telling him he will get in less trouble (probably a stern talking to) if he just comes clean. The spanking is never in anger and never harder than it needs to be.
But ultimately what this does is it establishes rules and boundaries. The rules are X and if you don't do X, Y is the result. Before any spanking we tell him what he did wrong, and most importantly how to fix it so it doesn't happen again.
He's 11 now and I've had to use it maybe 4 times? Possibly 5.
Setting boundaries is important.