
5 Mar
2008
5 Mar
'08
4:52 p.m.
On Wed, Mar 5, 2008 at 7:49 AM, Douglas Gregor <doug.gregor@gmail.com> wrote:
Why does everyone dislike throwing an exception to terminate the search?
I imagine that most people view using exceptions for control flow as being akin to using "goto". ;-) Under normal circumstances, they're probably right. However with deep nesting or recursion, I'm not so sure. Throwing certainly seems to offer an extremely simple way to do it. I bet if someone went ahead and benchmarked
the two options, the exception would be faster for graphs of non- trivial size.
I would be extremely interested in seeing any benchmark results. Jon