I working now on firm that using ref in every function.
The reason, is to catch errors.
There example :
//return true if the read is success
//otherwise writing to the error ,the problem
bool ReadFile(ref string error)
Question:
How do you catching errors?
Using ref,exceptions or other way?
I think that exceptions are the most convenient, robust and natural way to provide an error handling mechanism. They are just so feature-rich comparing to error codes and other things. The main problem is to actually classify an abnormal situation like ‘exceptional’. If the situation is not ‘exceptional’, than the above tactics is just fine.