From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10447 invoked by alias); 21 Mar 2008 15:24:11 -0000 Received: (qmail 10427 invoked by uid 22791); 21 Mar 2008 15:24:09 -0000 X-Spam-Check-By: sourceware.org Received: from hs-out-0708.google.com (HELO hs-out-0708.google.com) (64.233.178.251) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 21 Mar 2008 15:23:50 +0000 Received: by hs-out-0708.google.com with SMTP id 54so1220314hsz.8 for ; Fri, 21 Mar 2008 08:23:48 -0700 (PDT) Received: by 10.100.140.19 with SMTP id n19mr9238929and.23.1206113028112; Fri, 21 Mar 2008 08:23:48 -0700 (PDT) Received: by 10.100.135.17 with HTTP; Fri, 21 Mar 2008 08:23:48 -0700 (PDT) Message-ID: <70d0a1130803210823w473666aasbd5aee203bb8a130@mail.gmail.com> Date: Fri, 21 Mar 2008 15:24:00 -0000 From: "Noel Yap" To: "Jason Cipriani" Subject: Re: try, finally Cc: "John Love-Jensen" , GCC-help , "Ted Byers" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg00212.txt.bz2 On Thu, Mar 20, 2008 at 7:10 PM, Jason Cipriani wrote: > It seems that the root of any disagreement is what kinds of errors > we'd prefer to represent with exceptions. You and Ted would use them > for rare, fatal error conditions, similar in spirit to machine > exceptions such as access violations and invalid instructions. I would > use them for more common errors such as invalid user input, missing > files, network errors, etc. I would use them for network errors. Depending upon why files may be missing, I may or may not use them for that purpose. I would definitely not use them for invalid user input. I suppose where I would draw the line is whether or not the system has control over the inputs in question. For example, if a file is expected to exist because another system or a user is supposed to create the file, exceptions shouldn't be used. I will say, though, that this is how I use exceptions in C++. I'm much more lax with exception usage in languages like Python and possibly Java (I don't have that much experience with Java, but I did use exceptions for flow control in order to implement an ISO-8601 parser whose grammar seemed to require some lookahead, but I may just have lacked the skills to eliminate this (mis)use of exceptions). Noel