Try/Catch or test parameters
- by Ondra Morský
I was recently on a job interview and I was given a task to write simple method in C# to calculate when the trains meet. The code was simple mathematical equation.
What I did was that I checked all the parameters on the beginning of the method to make sure, that the code will not fail.
My question is: Is it better to check the parameters, or use…