If I am writing an API that takes an int parsed from a string, is it a good idea to seperate the parse method from the method that would do something with the "out" value?
My reason for thinking yes is that the code will be more clear. E.g. if I get an exception related to the parse, I can say in the stack "ah yes, that would be the top method called Parse() obviously!" before even looking at the codebase. I believe null is the wrong choice as it could introduce bugs by other developers who do not understand the technical decisions made (though I document this religously).
However, in a method that is 5 levels deep in the stack, how could I "Relay" an error string message?
Thanks