bleading edge by Jack Reeves

Discussion in 'C++' started by Denis Perelyubskiy, May 3, 2004.

  1. 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
     
    Denis Perelyubskiy, May 3, 2004
    #1
    1. Advertising

  2. Denis Perelyubskiy

    Phlip Guest

    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?TestFirstUserInterfaces
     
    Phlip, May 3, 2004
    #2
    1. Advertising

  3. Denis Perelyubskiy

    Jerry Coffin Guest

    Denis Perelyubskiy <> wrote in message news:<>...
    > 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.
     
    Jerry Coffin, May 3, 2004
    #3
  4. Denis Perelyubskiy

    Leor Zolman Guest

    On Sun, 02 May 2004 22:16:43 -0700, Denis Perelyubskiy
    <> 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
     
    Leor Zolman, May 3, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    2,290
  2. KiwiBrian

    Jack's Formmail 5

    KiwiBrian, Aug 25, 2004, in forum: HTML
    Replies:
    3
    Views:
    880
    Robert Frost-Bridges
    Aug 27, 2004
  3. malcolm
    Replies:
    19
    Views:
    472
    John J. Lee
    Jan 27, 2004
  4. Ferdi Smit
    Replies:
    0
    Views:
    785
    Ferdi Smit
    Oct 10, 2005
  5. denish
    Replies:
    5
    Views:
    5,708
Loading...

Share This Page