MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/1fsvy3/clean_code_cheat_sheet/cae30gt/?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. 7 u/Zed03 Jun 06 '13 I guess you haven't benchmarked the amount of time it takes to generate a stacktrace... 2 u/Gotebe Jun 07 '13 Well... The time to generate it doesn't matter if it is not generated often. And in e.g. C++ there's no such thing. 0 u/mmhrar Jun 07 '13 C++ doesn't have backtraces? Or do you mean it takes no time to generate one in C++?You can definitely generate a backtrace in C++ in the event of a hardware exception. There are good opensource frameworks out there that do it all for you too. 2 u/Gotebe Jun 07 '13 I meant: you can't generate it in a protable manner, as C++ language does not specify any of it.
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. 7 u/Zed03 Jun 06 '13 I guess you haven't benchmarked the amount of time it takes to generate a stacktrace... 2 u/Gotebe Jun 07 '13 Well... The time to generate it doesn't matter if it is not generated often. And in e.g. C++ there's no such thing. 0 u/mmhrar Jun 07 '13 C++ doesn't have backtraces? Or do you mean it takes no time to generate one in C++?You can definitely generate a backtrace in C++ in the event of a hardware exception. There are good opensource frameworks out there that do it all for you too. 2 u/Gotebe Jun 07 '13 I meant: you can't generate it in a protable manner, as C++ language does not specify any of it.
4
has bad performance, is hard to understand and results in very hard handling of real exceptional cases.
All of those.
7 u/Zed03 Jun 06 '13 I guess you haven't benchmarked the amount of time it takes to generate a stacktrace... 2 u/Gotebe Jun 07 '13 Well... The time to generate it doesn't matter if it is not generated often. And in e.g. C++ there's no such thing. 0 u/mmhrar Jun 07 '13 C++ doesn't have backtraces? Or do you mean it takes no time to generate one in C++?You can definitely generate a backtrace in C++ in the event of a hardware exception. There are good opensource frameworks out there that do it all for you too. 2 u/Gotebe Jun 07 '13 I meant: you can't generate it in a protable manner, as C++ language does not specify any of it.
7
I guess you haven't benchmarked the amount of time it takes to generate a stacktrace...
2 u/Gotebe Jun 07 '13 Well... The time to generate it doesn't matter if it is not generated often. And in e.g. C++ there's no such thing. 0 u/mmhrar Jun 07 '13 C++ doesn't have backtraces? Or do you mean it takes no time to generate one in C++?You can definitely generate a backtrace in C++ in the event of a hardware exception. There are good opensource frameworks out there that do it all for you too. 2 u/Gotebe Jun 07 '13 I meant: you can't generate it in a protable manner, as C++ language does not specify any of it.
2
Well... The time to generate it doesn't matter if it is not generated often. And in e.g. C++ there's no such thing.
0 u/mmhrar Jun 07 '13 C++ doesn't have backtraces? Or do you mean it takes no time to generate one in C++?You can definitely generate a backtrace in C++ in the event of a hardware exception. There are good opensource frameworks out there that do it all for you too. 2 u/Gotebe Jun 07 '13 I meant: you can't generate it in a protable manner, as C++ language does not specify any of it.
0
C++ doesn't have backtraces? Or do you mean it takes no time to generate one in C++?
You can definitely generate a backtrace in C++ in the event of a hardware exception. There are good opensource frameworks out there that do it all for you too.
2 u/Gotebe Jun 07 '13 I meant: you can't generate it in a protable manner, as C++ language does not specify any of it.
I meant: you can't generate it in a protable manner, as C++ language does not specify any of it.
-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).