You absolutely have to make it a deterrent and not a punishment. They're almost the same thing but you need to do it for the right reasons.
It's fine to have a deterrent as being a fine, imprisonment, electronic tag - even the death penalty if society agrees it. However it should be done as something to dissuade people from committing a crime, rather than done as something to make the victim/society feel better/exact a punishment/eye for an eye/etc.
I'm disgusted when the media interviews the family of a murder victim and they're calling for the death penalty and anybody takes that seriously. Revenge is disgusting and while it's understandable from the family of a victim, we should not be pandering to it at all.
It's a small distinction, but I think it's vital.
Except it's been proven that horrific punishments are not a deterrent.
The best deterrent is a high success rate in catching criminals, if the punishment is terrible, but there's only a 1% chance you'll be caught for robbing a few grands worth of stuff people will do it (look at all the middle eastern countries with whippings and hand severing).
But if there's a 99% chance you'll be caught but the sentence is only a year in prison people will be much less likely to do it because it's more likely to happen even if it's less unpleasant.
Deterrents work either on increasing rsk of being caught or making the results of being caught so horrific it's not worth even a small risk.
Also if your saying revenge is disgusting deterrents have to be deliberately sadistic to work.