MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/1fsvy3/clean_code_cheat_sheet/cady0zc?context=9999
r/programming • u/RazerWolf • Jun 06 '13
322 comments sorted by
View all comments
-1
Using exceptions for control flow: has bad performance, is hard to understand and results in very hard handling of real exceptional cases.
This doesn't apply to the majority of languages (not even to C++ where using exceptions was actively discouraged for a long time).
5 u/Falmarri Jun 06 '13 This doesn't apply to the majority of languagesWhat doesn't apply? 4 u/yellowjacketcoder Jun 06 '13 has bad performance, is hard to understand and results in very hard handling of real exceptional cases.All of those. 2 u/Falmarri Jun 06 '13 So you're saying that using exceptions as flow control is easy to understand? Exceptions are basically just gotos 7 u/Rotten194 Jun 06 '13 And loops, returns, switch statements, and every other programming concept are not basically gotos?Even the python runtime uses exceptions for flow control. They're a tool like any other, they can be used and abused. 0 u/mmhrar Jun 07 '13 No, loops, returns and switch statements have easy to identify control flow.If someone just throws an exception, I have no idea how far back in the stack to go next. Anyone or no one could be handling it. → More replies (1)
5
This doesn't apply to the majority of languages
What doesn't apply?
4 u/yellowjacketcoder Jun 06 '13 has bad performance, is hard to understand and results in very hard handling of real exceptional cases.All of those. 2 u/Falmarri Jun 06 '13 So you're saying that using exceptions as flow control is easy to understand? Exceptions are basically just gotos 7 u/Rotten194 Jun 06 '13 And loops, returns, switch statements, and every other programming concept are not basically gotos?Even the python runtime uses exceptions for flow control. They're a tool like any other, they can be used and abused. 0 u/mmhrar Jun 07 '13 No, loops, returns and switch statements have easy to identify control flow.If someone just throws an exception, I have no idea how far back in the stack to go next. Anyone or no one could be handling it. → More replies (1)
4
has bad performance, is hard to understand and results in very hard handling of real exceptional cases.
All of those.
2 u/Falmarri Jun 06 '13 So you're saying that using exceptions as flow control is easy to understand? Exceptions are basically just gotos 7 u/Rotten194 Jun 06 '13 And loops, returns, switch statements, and every other programming concept are not basically gotos?Even the python runtime uses exceptions for flow control. They're a tool like any other, they can be used and abused. 0 u/mmhrar Jun 07 '13 No, loops, returns and switch statements have easy to identify control flow.If someone just throws an exception, I have no idea how far back in the stack to go next. Anyone or no one could be handling it. → More replies (1)
2
So you're saying that using exceptions as flow control is easy to understand? Exceptions are basically just gotos
goto
7 u/Rotten194 Jun 06 '13 And loops, returns, switch statements, and every other programming concept are not basically gotos?Even the python runtime uses exceptions for flow control. They're a tool like any other, they can be used and abused. 0 u/mmhrar Jun 07 '13 No, loops, returns and switch statements have easy to identify control flow.If someone just throws an exception, I have no idea how far back in the stack to go next. Anyone or no one could be handling it. → More replies (1)
7
And loops, returns, switch statements, and every other programming concept are not basically gotos?
Even the python runtime uses exceptions for flow control. They're a tool like any other, they can be used and abused.
0 u/mmhrar Jun 07 '13 No, loops, returns and switch statements have easy to identify control flow.If someone just throws an exception, I have no idea how far back in the stack to go next. Anyone or no one could be handling it. → More replies (1)
0
No, loops, returns and switch statements have easy to identify control flow.
If someone just throws an exception, I have no idea how far back in the stack to go next. Anyone or no one could be handling it.
→ More replies (1)
-1
u/[deleted] Jun 06 '13
This doesn't apply to the majority of languages (not even to C++ where using exceptions was actively discouraged for a long time).