Phil, Whacking them with a machete, is a little extreme in 99.9% of the cases don't you think?
A stick would certainly deliver your message in a not so cruel way. Unless the dog was especially vicious/dangerous and a person was really at risk I don't think I would resort to that.