473,406 Members | 2,387 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,406 software developers and data experts.

Exceptions and object code bloat

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/
Nov 27 '06 #1
5 1858

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...

Nov 27 '06 #2
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
Nov 27 '06 #3
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/archi.../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/
Nov 28 '06 #4
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.
Nov 28 '06 #5

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/archi.../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

Nov 28 '06 #6

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

Similar topics

10
by: Eric | last post by:
I have been researching how exceptions and dynamic_cast work to determine if I will use either feature for a game-console application. I have a few pre-concieved notions and questions that I was...
3
by: Rick Collard | last post by:
I have been experimenting with the new Printer object in Access 2002 and discovered some unexpected database bloat. Simply assigning the same value to a property of a report's Printer object will...
14
by: dcassar | last post by:
I have had a lively discussion with some coworkers and decided to get some general feedback on an issue that I could find very little guidance on. Why is it considered bad practice to define a...
40
by: Mark P | last post by:
I'm implementing an algorithm and the computational flow is a somewhat deep. That is, fcn A makes many calls to fcn B which makes many calls to fcn C, and so on. The return value of the outermost...
11
by: sternr | last post by:
Hey, I use the following code: try { //Some code that has an exception } catch (Exception ex) { if (ex.innerException!=null) {throw ex.innerException;} }
4
by: Peyman | last post by:
Hi, I was reading the source code of an implementation of STL by HP company 1994, and Silicon Graphics Computer Systems, Inc. 1996, 1997. Which I found that for implementing a Linked List, they...
142
by: opexoc | last post by:
Hello, I have question concerning such code: __try { ... } __except(EXCEPTION_EXECUTE_HANDLER) { printf("Exception code: %.8x\n", GetExceptionCode());
0
RedSon
by: RedSon | last post by:
Chapter 3: What are the most common Exceptions and what do they mean? As we saw in the last chapter, there isn't only the standard Exception, but you also get special exceptions like...
0
by: PyNoob | last post by:
By default, uncaught exceptions stop the execution of python scripts (similar to what bash does when -e us set.) I need to change this behavior, so that the user gets informed about the uncaught...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.