What to Return? Error String, Bool with Error String Out, or Void with Exception?

There is no "one size fits all". If you return a flag, that makes it easy to use a method in if() and loops. Exceptions always need a lot of boiler plate code.

If you just want a string which you can display to the user (say, in a web UI), returning the error string (or null for "no error") is good, too.

Don't handle the exception or return a message of any kind. Let the consumer of your method take care of this.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions