Should a failed function return a value or throw an exception?
You have created a nice, well written function, but you realize you forgot something: The failure case.
What should a function do when it fails? There are two schools for this - the “throw an exception” school and the “return an error value” school.
But which of these is the correct approach?
Want to have your say? just login


Be first to show your opinion !!!