It may be effective in raising a child, but raising the child into what kind of person?
Hitting something that has neither the mental or physical capacities as you doesn't seem like it's effective in anything other than putting the victim in its place. It seems too easy. If you really wanted your child to learn from whatever it was that caused you to strike, why not sit them down and have a conversation about it? If you were going to do that anyway, why not forgo the violence altogether?
I'm paraphrasing here, but "Having a child does not make one a good parent anymore than having a piano makes one a pianist."