Exceptions

I have had a few programming classes now and it seems as though programmers are being trained to program for failure rather than success. One of the features of modern programming languages is exception handling. While this is a nice feature, because users do stupid things and we don’t always need an application to crash just because we might have a typoed letter in a box where we are only expecting numbers, it sets the wrong focus on programming. We don’t write code to “run” anymore, we write it to “try”, and then we catch anything that could go wrong. This is nice functionally speaking, but perhaps this is something that should be a little deeper in the language itself. It would be nice if a first-year programming student didn’t have to consider whether or not the user of his second program (first is always “Hello World” and output only) will return data that his variable won’t accept. In most languages, if you give bad data, the application will crash unconditionally, wouldn’t it be cool if programs could just naturally throw a generic type error and give the user a second chance?