[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: OT Re: reason behind fno-exceptions?
From:       Allan Sandfeld Jensen <snowwolf () one2one-networks ! com>
Date:       2001-07-31 13:04:58
[Download RAW message or body]

On Tuesday 31 July 2001 11:07, Guillaume Laurent wrote:
> On Tuesday 31 July 2001 09:57, Allan Sandfeld Jensen wrote:
> > Depends on what you do. Enabling exceptions means you have to write
> > catches in order to stay in control. I use pleanty of exceptions in java
> > and ML, but I _really_ dont use C++ for anything where I need that level
> > of abstractions. i.e. I need to know whats going on, and most c++
> > programmers do..
>
> I find that "knowing what's going on" is a very subjective notion in
> programming, usually depending on the language you use. :-)
>
> However, reading the above I still fail to see why you use exceptions in
> Java but not in C++, and why somehow in C++ they prevent you from "knowing
> what's going on".
>
Hmm. I guess you havent disassembled a program that DOESNT use exception with 
and without fno-exceptions. The overhead they talk about, is among other 
things also a lot of code, not dealing with what you wrote, but just dealing 
with exceptions. Try make a call to new() with and with-out exceptions, in 
the standard it _might_ cast an exception and gcc inserts code to deal with 
this. If you dont expect this and is programming low-level binaries or 
drivers, this is a serious hazard. Whats even more, since how exceptions are 
implemented are not general, you cant count on any specific behavior. 
A library shouldnt cast exceptions since this breaks non-exception handling 
user code, or insert various handlings per default. 
In java you dont have any feeling with what the program does i reality 
anyway, it's all simulated. That's a feature!! And still, even in java, it's 
recommended not to use exceptions, becouse they couse a serious performance 
problem. If you need an exception look at you program once more, and see how 
you can avoid it.


>
> Please try to be a little more rational about this. Hating a feature is no
> ground for wanting to be banned for everybody else. Exceptions are useful
> and a lot of people happily use them (including me). I certainly hope that
> in the future g++ will have a better implementation and KDE will be able to
> use them.
>
We dont need it. KDE can handle events in different (and better) ways..

But otherwise you're correct. There's is no reason to discuss personal 
preferences. It all depends on what you're doing.

regards
-Allan
 
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic