Training your puppy is always better than punishing them just because you're angry. Your puppy does not understand things like why peeing in the house is bad. Educating them with love is better than ineffective methods that only make them fearful.
More reading
Older dogs with CHF