Reply to post: Re: panic and recover functions.

Google's Go team decides not to give it a try

eldakka

Re: panic and recover functions.

Personally I've never understood the point of 'try'.

To me it adds complexity - more keywords, more complex compiler/interpreter, etc.

Whats wrong with:

do something

if ( error ) {

handle error

}

or even simpler (of course depends on language)

do something || handle error

These seem easier, using keywords/structures that are used commonly in the code for all sorts of things, rather than introducing and learning a new construct/keyword for one particular purpose, handling errors, that can be done just as well with the existing constructs.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon