Better HN
topnewbestaskshowjobs
Log inSign up

gleamer

4 karma · joined Mar 5, 2013 (13y ago) · 2 submissions

Submissions

comment 13y ago · link · parent

The main problem with the idea of abusing exceptions as a control flow structure is the fact that they were designed to subvert and obscure the flow of control of any program that uses them. If people start to mindlessly pull clever stunts such as relying on exceptions to implement their algorithms then their code becomes unreadable, unmaintainable and unauditable. Not only their code, but any code which happens to include it. Its only purpose is to create an unmanageable pile of spaghetti code which is needlessly hard to trace. And what good comes out of it?

comment 13y ago · link · parent

Exceptions, as implemented in languages such as C++, also influence the flow of execution. Therefore, technically, exceptions are a kind of control flow structure.

But it doesn't mean that abusing exceptions as control structures is a reasonable idea.