473,326 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

bleading edge by Jack Reeves

Hello,

In the archives of this newsgroup, I found references
to Jack Reeves' "(B)Leading Edge" column.

<http://www.bleading-edge.com/Publications/list.htm>

At this point, I am particularly interested in the
two columns : "Guidlelines for Throwing Exceptions",
and "Guidelines for Using Exception Specifications".

I was wondering if someone could comment on these
(and possibly other) columns with respect to their
applicability: they were written in 1996, and ANSI
approved the standard in 1998. Are there any
inconsistencies that you know about?

thanks...

denis
Jul 22 '05 #1
3 1295
Denis Perelyubskiy wrote:
In the archives of this newsgroup, I found references
to Jack Reeves' "(B)Leading Edge" column.

<http://www.bleading-edge.com/Publications/list.htm>

At this point, I am particularly interested in the
two columns : "Guidlelines for Throwing Exceptions",
and "Guidelines for Using Exception Specifications".

I was wondering if someone could comment on these
(and possibly other) columns with respect to their
applicability: they were written in 1996, and ANSI
approved the standard in 1998. Are there any
inconsistencies that you know about?


The least heinous treatises on exceptions, and how they influence every
other aspect of your style, are the /Exceptional C++/ books by Herb Sutter.
Read and compare with this guy.

--
Phlip
http://www.xpsd.org/cgi-bin/wiki?Tes...UserInterfaces
Jul 22 '05 #2
Denis Perelyubskiy <ne********@dslextreme.com> wrote in message news:<10*************@corp.supernews.com>...
Hello,

In the archives of this newsgroup, I found references
to Jack Reeves' "(B)Leading Edge" column.

<http://www.bleading-edge.com/Publications/list.htm>

At this point, I am particularly interested in the
two columns : "Guidlelines for Throwing Exceptions",
and "Guidelines for Using Exception Specifications".


They're amazingly good given their age. The one on throwing
exceptions is still quite good, though perhaps not strongly enough
worded in places. Just for an obvious example, it tells you not to
throw exceptions from destructors. This is good advice, but IMO it
doesn't really go far enough: in a dtor, you must ensure that not only
do you not throw an exception, but that if you do anything else that
could possibly throw an exception, you must trap it and not allow it
to escape.

Likewise with the article on exception specifications: he advises
against using them if you can avoid it, and gives some advice about
how to limit the damage they do when you use them.

My advice would be simpler: don't use them. Ever. Under any
circumstances or for any reason at all.

Some people advise that an exception (no pun intended) be made for the
empty exception specification, but I disagree even with that. It's
still trouble and it makes your code more fragile -- even when you
write a function that you know can't throw, sometime later it'll
inevitably get modified to do something that can throw under _some_
obscure circumstances, and then you have a latent bug. Worse, it's
probably almost impossible to duplicate under laboratory conditions.

Exception specifications were an idea that seemed like a good idea at
the time, but I think it's fairly safe to say they were a mistake.
It's been argued that exception specifications that are checked at
compile time would be an improvement, but expeience with Java (which
has exactly that) mostly seems to indicate that even these are still a
net loss.
--
Later,
Jerry.

The universe is a figment of its own imagination.
Jul 22 '05 #3
On Sun, 02 May 2004 22:16:43 -0700, Denis Perelyubskiy
<ne********@dslextreme.com> wrote:
Hello,

In the archives of this newsgroup, I found references
to Jack Reeves' "(B)Leading Edge" column.

<http://www.bleading-edge.com/Publications/list.htm>

At this point, I am particularly interested in the
two columns : "Guidlelines for Throwing Exceptions",
and "Guidelines for Using Exception Specifications".

I was wondering if someone could comment on these
(and possibly other) columns with respect to their
applicability: they were written in 1996, and ANSI
approved the standard in 1998. Are there any
inconsistencies that you know about?


Jack actually takes himself to task on these issues with a later Bleading
Edge column in the CUJ Expert's Forum:
http://www.cuj.com/documents/s=8247/cujcexp2103reeves/

-leor

--
Leor Zolman --- BD Software --- www.bdsoft.com
On-Site Training in C/C++, Java, Perl and Unix
C++ users: download BD Software's free STL Error Message Decryptor at:
www.bdsoft.com/tools/stlfilt.html
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ferdi Smit | last post by:
I wrote a generic algorithm for boost.graph to merge two vertices, ie. the end-points of an edge are joined together as if they are a single vertex. I'm currently doing this by creating a new...
2
by: copyco | last post by:
Does anyone have any suggestions on this? I have a form that can be collapsed into a compact size and expanded back to full size. If the user moves the compact size of the form close to the edge,...
2
by: as | last post by:
Hi folks, am a newbie in C++ world. Normally I use matlab more often. But right now I want to create a Rising Edge D Flip-Flop model which has two Digital inputs, i.e. INPUTDATA and a CLOCK. The...
0
by: darrenhello | last post by:
hi there, I am doing my last year's project and I have a 'little' problem. I have to do an edge detection filter. for now, some normal edge detection filters that I used worked fine but there a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.