There are thousands of questions embedded in this short paragraph. But I will skip them all and go right to punishment. If it is a price to pay, then the commission of a crime becomes some sort of calculus. A deterrent is simply raising the penalty high enough to discourage future criminal activity. Of course we may never know how many crimes were prevented, if any.
Revenge is definitely another story.
Here we are dealing with our base emotions. I had no idea how woefully weak is my understanding of punishment until I started to think about it. All I can do here is list some of the problems that bother me. The ages around 14 and 15 mark the start of frontal lobe development, while the end occurs near 20 and 21. Frontal lobes are where rational thought occurs.