I don't think it really matters if it's a deterrent or not. I always think of the death penalty as justice being implemented, not vengeance or a 'warning to others'