After viewing code posted on the forums and exceptions causing complete crashing of plugins and ArcheBuddy completely has lead me to one conclusion. Simply put, where in the **** are all the exception handling? unit testing? try/catch? I just feel like people don't understand the necessity of a few things when coding using .NET C#:
1. Clean and Well Formatted Code with XML Documentation
2. Try/Catch and Exception Handling
3. Use Locks when accessing data and variables your threads share. (Parallel Programming 101: Data Races)
The biggest is the exception handling and try/catch use. You don't have to handle the exception at every level of every function. Simple implement...
At the highest levels of your functions, the big guys, you do major exception handling. This is the best way to also try something that you know will cause an exception without crashing your program.
What do you guys think?
1. Clean and Well Formatted Code with XML Documentation
2. Try/Catch and Exception Handling
3. Use Locks when accessing data and variables your threads share. (Parallel Programming 101: Data Races)
The biggest is the exception handling and try/catch use. You don't have to handle the exception at every level of every function. Simple implement...
Code:
try
{
// Code Here
}
catch // you don't have to actually specify an exception here, unless you plan on handling a specific exception like IOException, just throw. It helps with the stack trace.
{
// Log Message
throw;
}
At the highest levels of your functions, the big guys, you do major exception handling. This is the best way to also try something that you know will cause an exception without crashing your program.
What do you guys think?