Exceptions and object code bloat

Discussion in 'C++' started by Steven T. Hatton, Nov 27, 2006.

  1. I'm engaged in a discussion on the Qt mailing list regarding exceptions. It
    has been stated that exception handling leads to significantly larger
    executable images than does 'error-code' programming. Nobody has provided
    a concrete example of this, and I would like to know what the technical
    issues really are. Searching the Internet only resulted in finding more
    rumor and legend regarding this issue. What are the facts?
    --
    NOUN:1. Money or property bequeathed to another by will. 2. Something handed
    down from an ancestor or a predecessor or from the past: a legacy of
    religious freedom. ETYMOLOGY: MidE legacie, office of a deputy, from OF,
    from ML legatia, from L legare, to depute, bequeath. www.bartleby.com/61/
     
    Steven T. Hatton, Nov 27, 2006
    #1
    1. Advertising

  2. Steven T. Hatton

    Noah Roberts Guest

    Steven T. Hatton wrote:
    > I'm engaged in a discussion on the Qt mailing list regarding exceptions. It
    > has been stated that exception handling leads to significantly larger
    > executable images than does 'error-code' programming. Nobody has provided
    > a concrete example of this, and I would like to know what the technical
    > issues really are. Searching the Internet only resulted in finding more
    > rumor and legend regarding this issue. What are the facts?


    http://www.open-std.org/jtc1/sc22/wg21/docs/18015.html

    The facts are, if it isn't measurable and there are no concrete
    examples showing that code blote exists then it can't very well be
    significant. I feel for you, but at least you're just dealing with
    people on some OSS email list and not in the workplace. I had a
    manager that wouldn't let us use exceptions because of this unseen and
    unmeasured "bloat" and "speed costs".

    Good luck convincing them...
     
    Noah Roberts, Nov 27, 2006
    #2
    1. Advertising

  3. Steven T. Hatton wrote:

    > I'm engaged in a discussion on the Qt mailing list regarding exceptions.
    > It has been stated that exception handling leads to significantly larger
    > executable images than does 'error-code' programming. Nobody has provided
    > a concrete example of this, and I would like to know what the technical
    > issues really are. Searching the Internet only resulted in finding more
    > rumor and legend regarding this issue. What are the facts?


    I think the only clear fact is: nobody is willing to write a large program
    in two versions just to try to prove a point.

    And even if somebody do it, no one will believe his results.

    And even if the results were indisputable, nobody will change his
    programming style because of that.

    So better don't waste your time.

    --
    Salu2
     
    =?ISO-8859-15?Q?Juli=E1n?= Albo, Nov 28, 2006
    #3
  4. Julián Albo wrote:

    > Steven T. Hatton wrote:
    >
    >> I'm engaged in a discussion on the Qt mailing list regarding exceptions.
    >> It has been stated that exception handling leads to significantly larger
    >> executable images than does 'error-code' programming. Nobody has
    >> provided a concrete example of this, and I would like to know what the
    >> technical
    >> issues really are. Searching the Internet only resulted in finding more
    >> rumor and legend regarding this issue. What are the facts?

    >
    > I think the only clear fact is: nobody is willing to write a large program
    > in two versions just to try to prove a point.
    >
    > And even if somebody do it, no one will believe his results.
    >
    > And even if the results were indisputable, nobody will change his
    > programming style because of that.
    >
    > So better don't waste your time.
    >

    I have limited, if diminishing, faith that there are some rational human
    beings in the world. Since I use Qt, and the discussion is about how Qt is
    designed, it is more than a matter of persuading other people to do what
    makes sense for themselves. I have to live with the choices made. Since
    Trolltech makes their money by satisfying the user community, an
    ill-informed user community is inevitably going to want things which don't
    make sense. The same applies to the C++ community as a whole.

    For example, compare what is said about virtual functions in the first paper
    found here:
    http://www.open-std.org/jtc1/sc22/wg21/docs/18015.html
    with Stan Lippman's observations found here:
    http://blogs.msdn.com/slippman/archive/2004/01/27/63473.aspx

    If people were only exposed to the first view, they might accept it as the
    only valid approach: "If C++ is not used anywhere in a project, then the
    possibility of a virtual base class 'sneaking' into the code base is
    eliminated."
    --
    NOUN:1. Money or property bequeathed to another by will. 2. Something handed
    down from an ancestor or a predecessor or from the past: a legacy of
    religious freedom. ETYMOLOGY: MidE legacie, office of a deputy, from OF,
    from ML legatia, from L legare, to depute, bequeath. www.bartleby.com/61/
     
    Steven T. Hatton, Nov 28, 2006
    #4
  5. Steven T. Hatton

    Ian Collins Guest

    Steven T. Hatton wrote:
    > I'm engaged in a discussion on the Qt mailing list regarding exceptions. It
    > has been stated that exception handling leads to significantly larger
    > executable images than does 'error-code' programming. Nobody has provided
    > a concrete example of this, and I would like to know what the technical
    > issues really are. Searching the Internet only resulted in finding more
    > rumor and legend regarding this issue. What are the facts?


    It all depends on the compiler. Some are piss poor at generating code
    with exceptions, others introduce next to no overhead.

    Unfortunately, I have to use one of each at the moment...

    --
    Ian Collins.
     
    Ian Collins, Nov 28, 2006
    #5
  6. Steven T. Hatton wrote:

    > Julián Albo wrote:
    >
    > > Steven T. Hatton wrote:
    > >
    > >> I'm engaged in a discussion on the Qt mailing list regarding exceptions.
    > >> It has been stated that exception handling leads to significantly larger
    > >> executable images than does 'error-code' programming. Nobody has
    > >> provided a concrete example of this, and I would like to know what the
    > >> technical
    > >> issues really are. Searching the Internet only resulted in finding more
    > >> rumor and legend regarding this issue. What are the facts?

    > >
    > > I think the only clear fact is: nobody is willing to write a large program
    > > in two versions just to try to prove a point.
    > >
    > > And even if somebody do it, no one will believe his results.
    > >
    > > And even if the results were indisputable, nobody will change his
    > > programming style because of that.
    > >
    > > So better don't waste your time.
    > >

    > I have limited, if diminishing, faith that there are some rational human
    > beings in the world. Since I use Qt, and the discussion is about how Qt is
    > designed, it is more than a matter of persuading other people to do what
    > makes sense for themselves. I have to live with the choices made. Since
    > Trolltech makes their money by satisfying the user community, an
    > ill-informed user community is inevitably going to want things which don't
    > make sense. The same applies to the C++ community as a whole.
    >
    > For example, compare what is said about virtual functions in the first paper
    > found here:
    > http://www.open-std.org/jtc1/sc22/wg21/docs/18015.html
    > with Stan Lippman's observations found here:
    > http://blogs.msdn.com/slippman/archive/2004/01/27/63473.aspx
    >
    > If people were only exposed to the first view, they might accept it as the
    > only valid approach: "If C++ is not used anywhere in a project, then the
    > possibility of a virtual base class 'sneaking' into the code base is
    > eliminated."


    <rant>

    OO seems to have become synonymous with inheritance and of course it
    just isn't so. The STL is a brilliant execution of OO concepts. In
    reality OO focuses on message passing concepts not on inheritance -
    there are OO languages that don't have inheritance, but all have a
    concept of separation between message and method.

    With C++ we are lucky because we can use just about any message to
    method delivery mechanism we want. Static binding and virtual binding
    are two obvious ones, but generics is simply another way of tying a
    message to a method. We can also implement our own. MFC does this in
    delivering window messages to objects and my company's FOST.3 framework
    uses a custom message delivery system to determine how to build and
    process object edit forms in HTML at run-time.

    The problem with inheritance is the problem with all taxonomies -
    they're arbitrary and in the real world nearly impossible to get right.
    But it seems familiar to students when they learn OO as it is seems to
    reflect how people see the world (but they always neglect the special
    cases).

    Message passing on the other hand seems nebulous, but once understood
    it makes systems much easier to see for what they really are - an
    exchange of information that needs to be acted upon. Lippman's example
    is one of looking at how to get the messages to invoke the right
    methods - once you think about the problem in that way the use of
    templates to provide this wiring becomes much easier to understand and
    to see.

    </rant> :)


    K
     
    =?iso-8859-1?q?Kirit_S=E6lensminde?=, Nov 28, 2006
    #6
    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. Salvador I. Ducros

    STL & reducing code bloat

    Salvador I. Ducros, Jul 28, 2003, in forum: C++
    Replies:
    5
    Views:
    1,588
    Howard Hinnant
    Aug 5, 2003
  2. RainBow
    Replies:
    6
    Views:
    367
  3. Tony
    Replies:
    48
    Views:
    1,158
    Mathias Gaunard
    Dec 12, 2006
  4. BGB / cr88192

    hmm: code bloat?...

    BGB / cr88192, Jan 5, 2010, in forum: C Programming
    Replies:
    16
    Views:
    606
    BGB / cr88192
    Jan 6, 2010
  5. Max Metral

    HTML Title/Meta Attributes, ID tags, and code bloat

    Max Metral, Feb 24, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    175
    Sarmad Aljazrawi
    Feb 24, 2004
Loading...

Share This Page