Spanking really is not an effective means of discipline. If the child hit something or threw something, and you tell him that his action is wrong by hitting him in return, it is a confusing message.
Reward good behavior with a cereal (a few pieces of Trix and Froot Loops Cereal are good options)from the time he/she can eat whole foods. For bad behavior tell the child "no, we don't do that," have them apologize, and have them sit in a time out or isolated from a group for a period of time. If the same behavior persists then begin to take away things that have importance to the child until they behave appropriately. It's important to reward good behavior during this time as well so they can distinguish good from bad.
One of the most important lessons is public tantrums, like in a grocery store. Give the child 1 (and I mean ONE) warning that they need to act proper or you will leave immediately. If the behavior persists, drop whatever you are doing and go home IMMEDIATELY(or to the car, or a room. Somewhere away from the bad behavior display). After two episodes like this a child will take the warning seriously and do as you say.
It's extremely important to stay consistent with discipline and not make exceptions. And as a parent that's the hardest thing to do (oh, he hasn't had his nap today, he's just tired and crabby...etc) because even during that time you still need to be firm with your teaching. But always remember, kids are kids and they will always do their best to push the line. You just have to be the better defensive player.