What are the pros and cons of error handling at beginning vs. end of the method
问题 In my programmer's experience, I have mixed error handling all the ways possible... I have created my personal style. However, I'd like to hear what you consider to be the pro and cons of error handling at the beginning vs at the end of the method. Handling at the beginning: public String GenerateSomeStringData(String data, int value) { if (data == null) throw new ArgumentNullException("data"); if (value <= 0) throw new ArgumentException("value must be greater than zero"); int dataValue; if (