Rethrowing the exception incorrectly. To rethrow an exception :
try
{
// do some stuff here
}
catch (Exception ex)
{
throw ex; // INCORRECT
throw; // CORRECT
throw new Exception("There was an error"); // INCORRECT
throw new Exception("There was an error", ex); // CORRECT
}
GC.Collect()
to collect instead of trusting the garbage collector.
I see this one way too much, both in Java and C#...
if(something == true){
somethingelse = true;
}
with bonus points if it also has
else{
somethingelse = false;
}
using Microsoft.SharePoint;
'nuff said
I see following code a lot:
if (i==3)
return true;
else
return false;
should be:
return (i==3);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With