mercredi 26 juillet 2017

'return' from try block in C# and C++

I have a vary simple question on C# and C++: is it a good practice to use 'return' in try block? A long time ago I heard that it can produce some troubles for a compiler. But probably the modern compilers can handle this situation. Sample code:

try
{
   //do something
   return 25;
   //do something else
}
catch (Exception)
{
}

Aucun commentaire:

Enregistrer un commentaire