Slashdot videos: Now with more Slashdot!
Execution is not a deterrent because they take place behind walls and virtually no one sees them. Out of sight, out of mind. If they are going to execute people, then do it in the public square in a way that shocks people (hanging, guillotine, etc). Couple that with executing prosecutors and cops who through malice or complete incompetence cause an innocent person to be executed. Like as not, the latter will reduce to an absolute minimum the former. And when an execution does happen, people will be shown the consequences if they murder in no uncertain terms.
If you don't do it in public, then don't execute people. Without being a real deterrent it serves no purpose and is more merciful than keeping them in a cage (but for fuck's sake, stop giving them TVs and other shit that makes the time go fast).