Home > Articles > Coding > Where to crash? by Yash K.S

Where to crash? by Yash K.S

Posted: March 20th, 2007 @ 7:15am

Program crashing is more critical compare to other kinds of bug in a product. No client wants crash after paying money for the product. Most Programmers will blindly put try/catch kind of exception handlers to prevent crashing. Instead, allow following things to happen:
Return some error code saying that function call is failed along with error code
Write log file saying that it is crashed and continue execution
Allow code to continue execution if exception is not critical
Program crash can happen in 2 places:
Inside the company
Outside the company
If we allow product to crash in Client place, then ready to loose the customer. client paid money for the product features which you provide not for unnecessary crashes and unwanted bugs. If you allow product to crash inside the company, then you have good chance to look into problem.
To get more crashed inside the company itself. Do not put any try/catch kind of exception handlers during testing the code inside the company. If there is a crash then do not continue executing program, instead need to halt the program immediately for analyzing further code with dumping as much as log information or using crash dump file. If there is a code where you know very clearly that exception is going to occur and if u can justify to put try/catch handler always, then its perfect.
During shipping the product outside the company enable try/catch kind of handlers where it doesn't crash the program, rather it terminates with some error code and log file, these error code and log file is supposed to be helpful later for developers to debug the crash and fix it and send it back to customer. Client should report back to you saying that "Product terminated with some error code", rather then saying that "Your product is crashed".
"Allow Program to crash FAST within your company, instead allowing program to crash in client place"