Is it better to surrender early in blackjack if I don't have good cards?

If you surrender early you only lose half your bet, so in the long run it seems to make a lot of sense to get out if your cards are bad. However, it is always a risk because even what seem to be really bad hands can end up winning if played right, and the dealer busts. There are no sure things on the casino floor.