Timeline for Returning a variable or a return code from a function
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 19, 2016 at 14:27 | vote | accept | filaton | ||
| Apr 19, 2016 at 14:06 | answer | added | sara | timeline score: 1 | |
| Apr 19, 2016 at 13:20 | comment | added | filaton | 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 :) | |
| Apr 19, 2016 at 12:59 | comment | added | Vincent Savard | 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. | |
| Apr 19, 2016 at 12:58 | comment | added | filaton | 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. | |
| Apr 19, 2016 at 12:38 | review | Close votes | |||
| Apr 26, 2016 at 3:01 | |||||
| Apr 19, 2016 at 12:26 | comment | added | Vincent Savard | Both styles seem rather poor in Python. Why not raise an exception on failure? | |
| Apr 19, 2016 at 12:24 | review | First posts | |||
| Apr 20, 2016 at 18:39 | |||||
| Apr 19, 2016 at 12:21 | history | asked | filaton | CC BY-SA 3.0 |