|
Boost Users : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-09-19 11:19:43
From: "Mark Storer" <mstorer_at_[hidden]>
> Using exceptions in this way just bugs me. Religious reasons I guess. As
> the Esteemed Mr. Hylsop ;) mentioned earlier, exceptions are for "oops".
> This seems alot like the whole "do{}while(0)" with various 'break'
> statements sprinkled in to avoid multiple returns/nested ifs. Useful, but
> Just Not Right.
A common misconception. Many people try to project their own
ideas/expectations on language features, rather than simply using them as
tools where appropriate. There is nothing "oops"-y about exceptions. They
are a control flow mechanism; one that has interesting properties, but a
control flow mechanism nonetheless. If it works and leads to a better code,
it's foolish to avoid it without a technical reason.
A similar example is when people don't use "struct" for C++ classes because
it "doesn't feel right", or when trying to choose between "typename" and
"class" for template parameters. The language features simply do not carry
this kind of religious/emotional payload. It's all in your mind.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net