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

List:       kde-devel
Subject:    Re: C++ exceptions
From:       David Johnson <david () usermode ! org>
Date:       2005-12-06 2:04:14
Message-ID: 200512051804.14340.david () usermode ! org
[Download RAW message or body]

On Monday 05 December 2005 05:55 am, R.F. Pels wrote:
> Not to mention the fact I had to
> use my airsickness bag when I saw the 'use-return-codes' solution.

Here's the style of code that causes me to reach for that little baggie:

void function() {
  try {
    doFirst();
  }
  catch (conditionA) {
    recoverA();
  }
  catch (conditionB) {
    recoverB();
  }
  try {
    doSecond();
  }
  catch (conditionC) {
    recoverAB();
  }
  try (conditionD) {
    doThird();
  }
  catch {
    recoverD();
  }
  try (conditionE) {
    doFourth();
  }
  catch {
    recoverFourth();
  }
}

I'm sorry that my tiny gripe spun off into such a contentious debate, 
but maybe, just maybe, it's a sign that exceptions aren't the 
wonderfully simplistic panaceas that people think they are. Perhaps 
there are some pitfalls and drawbacks associated with them.

-- 
David Johnson
 
>> Visit http://mail.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