Timeline for Are exceptions as control flow considered a serious antipattern? If so, Why?
Current License: CC BY-SA 4.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 13, 2023 at 3:44 | comment | added | user148298 | There are two exceptions, low level and high-level. A low level exception is one thrown by a file or keyboard io function further down the stack, for instance. A high level one catches a lower level one and rethrows it as is, or rethrows it with a more specific or detailed message which can be presented to the user. High level exceptions can be abused, but they are the best way of meaningfully reporting errors. | |
Nov 17, 2022 at 8:09 | comment | added | symbiont | @MirroredFate i like how you separated the problem it solves from the negatives. i think this is a pretty good. except for the last section about anti-pattern. you could mention lower performance as a negative consequence. you could also give a concrete example of exception as control flow, so that we are all on the same page. you could even give an example of exceptions fixing the the arrow anti-pattern, before the last section | |
Mar 24, 2022 at 16:52 | history | edited | MirroredFate | CC BY-SA 4.0 |
added 36 characters in body
|
S Jul 2, 2020 at 20:15 | history | suggested | CommunityBot | CC BY-SA 4.0 |
Fix grammatical error with extra words that were redundant
|
Jul 2, 2020 at 7:48 | review | Suggested edits | |||
S Jul 2, 2020 at 20:15 | |||||
Apr 6, 2018 at 17:31 | comment | added | MirroredFate | @Maybe_Factor Per the definition of an ant-pattern, no. | |
Apr 5, 2018 at 6:30 | comment | added | Maybe_Factor | "It's a poor way to do things" - Shouldn't that be enough to classify it as an anti-pattern? | |
Apr 4, 2018 at 18:35 | history | edited | MirroredFate | CC BY-SA 3.0 |
deleted 1 character in body
|
Jan 6, 2017 at 4:03 | comment | added | maaartinus | There's one bad consequence, at least in languages providing a full stack trace. As the code is heavily optimized with a lot of inlining, the real stack trace and the one a developer wants to see differ a lot and therefore the stack trace generation is costly. Overusing exceptions is very bad for performance in such languages (Java, C#). | |
Jun 28, 2016 at 23:51 | history | answered | MirroredFate | CC BY-SA 3.0 |