It's very popular to see codes like this :
bool DoSomething([some arguments]);
I mean you can't understand what's the result of this method by looking at its name.(actually it could be a void)
What's the best approach to refactor such kind of methods ? what I have in mind is something like this :
void DoSomething([some argumens],out bool everythingIsOk);
What do you think ?
It seems that so many people prefer
rather than :
void DoSomething(out bool success);
but what if method is going to have a result instead of being void .Can we Use
int.TryParse pattern or we should return the result and throw an exception if something goes wrong ?