Boost logo

Boost Users :

From: Jeff Faust (jeff_at_[hidden])
Date: 2002-09-19 11:28:11


Something is more maintainable if it is more understood. Exceptions are
meant for exceptional cases. At least that's a common conception, one which
I follow. Even thier name suggests their usage. Maintenance is a very good
reason to stay within expectations.

Staying within expectations may mean sacrificing performance. There is
often a trade-off between performance and maintainability. The pros and
cons should be weighed and a choice made.

Jeff

-----Original Message-----
From: Peter Dimov [mailto:pdimov_at_[hidden]]

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.

Info: <http://www.boost.org>
Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


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