3 ms·
I think this argument is generally taken out of context; my biggest concern would indeed be that using exceptions for control flow is non-idiomatic currently fo
by danielbarla 14y ago
I think this argument is generally taken out of context; my biggest concern would indeed be that using exceptions for control flow is non-idiomatic currently for most mainstream languages (and yes, Python disagrees).
This means that going against the grain will cost you time (and not you necessarily, but your company / colleagues, etc), and that time better come with some great benefits for it to be worthwhile.
So really, the argument can be looked at from many angles, depending on what value system you are using / what you would like to optimise for. I like to optimise for least surprises / development time.
- gleamer 14y agoThe 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?
- danielbarla 14y agoWell, I tend to agree; but keeping an open mind, this might just be our subjective rationalisation because we don't understand a newer / better approach. My point is just that even if the exception-raising approach was better, it'd take a lot of time before it would become truly idiomatic and allow us to reap its benefits, on a software engineering level. I know many would disagree with me on this, however; I like to think I'm a realist.