8
jxsv
7y

My boss can't grasp why he should use exceptions instead of return codes in his code.

Comments
  • 2
    But his code is exceptional
  • 1
    Exceptions are for that - exceptional cases. Return codes are for that - return status.

    If you are using exceptions to control flow, get shot.
  • 0
    @addvilz does "if ($$$ISOK(status)) {} else {}" seem like proper justification for status code use?
  • 0
    Depends. I certainly wouldnt write it like this, but for boolean logic it's ok. If the return status is complex but expected, use value objects.
Add Comment