Each transgression may be punished to that degree, and with so much severity, as will suffice to make it an ill bargain to the offender, give him cause to repent, and terrify others from doing the like.
Gist of Idea
Punishment should make crime a bad bargain, leading to repentance and deterrence
John Locke (Second Treatise of Government , 012)
I gather that the consensus among experts is that the biggest deterrence is a high likelihood of being caught, rather than the severity of the punishment.
Locke,John: 'Two Treatises of Government' [Everyman 1988], p.122