Try Catch Overkill

  • Thread starter Thread starter pigeonrandle
  • Start date Start date
Jon,

Although you are right, is the unnecessary use of a try catch block at least
not good maintenable.
(A global catch can in my idea only be used if you are not sure of the
quality of your code).

I know that you did not write this to promote to use everywhere try and
catch block, but before somebody would understand that from your message.

Cor
 
Bruce,

I don't agree with you about the try catch inside a try catch.

If you are not sure that there is a database server connected in some
situation (take by instance over the Internet) than I like to use a try
catch for that.

Inside that try catch block comes than a the normal processing with a try
catch block by instance for as that server goes ofline or any other error.

There are plenty of other situations like this.

Just my idea,

Cor
 
Hi,

Is it me or is this like the whole 'goto' argument all over again?! If
you declare uninitialised variables outside the try ... catch, then you
have to option of using 'serial' try ... catch blocks, as opposed to
nested ones since the variables are always in scope.

Cheers all,
James.
 
Back
Top