I personally think (I might be wrong), that these terrorists are so called terrorists because they are prepared to die. Be it by the bullet, or by hanging or by any other means.
By giving them the death penalty. You are doing them a favour.
I think that these people should be punished in public for the rest of their life. This way people will fear and respect the law, which will inturn decrease the crime rate.