Timeline for Throw exception or let code fail
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 26, 2015 at 17:54 | comment | added | user949300 | @Philipp In the case the coder/spec has decided that there is no error when you try to Load twice. The return value is, in that sense, not an error value but an informational one. | |
Jan 23, 2015 at 16:15 | history | edited | gnat | CC BY-SA 3.0 |
code formatting
|
Jan 23, 2015 at 13:48 | comment | added | MrIveck | I think I found the solution myself: en.wikipedia.org/wiki/… This points out that Ixrec's answer is the most correct | |
Jan 23, 2015 at 12:42 | comment | added | MrIveck | Is this alway's the case? I thought it was only the case with semipredicate (en.wikipedia.org/wiki/Semipredicate_problem) Because in OP code sample, failing to add a material to the system is no real problem. The method purpose it to make sure that the material is in the system when you run it, and that is exactly what this method does. (even if it fails) The returning boolean just indicates if the method already tried to add this matterial or not. ps: I don't take into consideration that there could be multiple matterials with the same name. | |
Jan 23, 2015 at 10:03 | comment | added | Philipp | Functions which return error values is exactly the anti-pattern which exceptions are supposed to make obsolete. | |
Jan 23, 2015 at 9:37 | review | First posts | |||
Jan 23, 2015 at 10:28 | |||||
Jan 23, 2015 at 9:35 | history | answered | MrIveck | CC BY-SA 3.0 |