Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 1
    Both styles seem rather poor in Python. Why not raise an exception on failure? Commented Apr 19, 2016 at 12:26
  • I used Python to describe that case just because I wanted to keep the example simple but I would obviously raise an exception in Python for that. My question is rather about the general case. Commented Apr 19, 2016 at 12:58
  • 3
    Then why would you tag Python to the question? It's far from obvious. We're not in your head. The question isn't even answerable in the general case, it entirely depends on the language and the paradigm you're using. Commented Apr 19, 2016 at 12:59
  • I tagged it with Python because it's the language I used to describe the example but I specified "In Python for instance" so I thought people would understand that it's not a Python-specific question. I'm not asking for a fixed answer working in all situations, just some reasons to choose one style over the other. If it depends on the paradigm you use, your answer can be paradigm-specific :) Commented Apr 19, 2016 at 13:20