It is certainly true that pain acts as a deterrent for just about any sentient creature. Therefore, if your cat has a tendency to exhibit problem behavior, it will become markedly less likely to do so if you inflict pain as a punishment. However, we have reached a stage where it is frowned upon for humans to use physical punishment as a way of correcting the behavior of their children – so why would one do this to their cat?
Just because cats are smaller, not human, and have different “laws”, it does not make it OK to beat a cat as punishment for a transgression. It is particularly worthless as a punishment when it is done, as it often is, some time after the event of its misbehavior. This won’t help you and it certainly won’t help your cat.
Instead of physical punishment inflicting pain, it is much better to encourage your cat to behave in a more reasonable way by making the actions which bother you uncomfortable for the cat. Therefore, if you are sick of your cat climbing the curtains, a fine mist of water sprayed from a nozzle can be a whole lot more effective than a slap. By being consistent in this response, you can get to the stage where even reaching for the bottle will warn your cat.
Additionally, if your cat has a tendency to “go” in a certain spot, which it considers to be its territory, sprinkling lemon juice in that spot will encourage it to give that up. Cats hate citrus smells, and “remarking your territory” will convince it of the futility of its actions.