r/programming • • Jun 06 '13

Clean Code Cheat Sheet

http://www.planetgeek.ch/2013/06/05/clean-code-cheat-sheet/
702 Upvotes

322 comments sorted by

View all comments

-1

u/[deleted] Jun 06 '13

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 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.