From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 272CABC0A for ; Sun, 10 Dec 2006 14:27:07 +0100 (CET) Received: from ext.lri.fr (ext.lri.fr [129.175.15.4]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBADR6uf007921 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 10 Dec 2006 14:27:06 +0100 Received: from smtp.lri.fr (serveur3-5 [129.175.3.5]) by ext.lri.fr (Postfix) with ESMTP id 84FA020212D; Sun, 10 Dec 2006 14:27:06 +0100 (CET) Received: from serveur9-10.lri.fr (serveur9-10 [129.175.9.10]) by smtp.lri.fr (Postfix) with ESMTP id 80B5DCED98; Sun, 10 Dec 2006 14:27:06 +0100 (CET) Received: from filliatr by serveur9-10.lri.fr with local (Exim 3.36 #1 (Debian)) id 1GtOhu-0004uS-00; Sun, 10 Dec 2006 14:27:06 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17788.2858.414320.138285@serveur9-10.lri.fr> Date: Sun, 10 Dec 2006 14:27:06 +0100 To: "Andreas Rossberg" Cc: "caml-list" Subject: Re: [Caml-list] Today's inflamatory opinion: exceptions are bad In-Reply-To: <004501c71c40$b52e8d00$15b2a8c0@wiko> References: <004501c71c40$b52e8d00$15b2a8c0@wiko> X-Mailer: VM 7.19 under Emacs 21.4.1 From: Jean-Christophe Filliatre X-Virus-Scanned: by amavisd-new at lri.fr X-Miltered: at discorde with ID 457C0B2A.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; filliatre:01 filliatr:01 lri:01 rossberg:01 erlang:01 erlang:01 fame:98 writes:01 caml-list:01 andreas:01 thesis:01 exceptions:01 exceptions:01 philosophy:02 programming:03 Andreas Rossberg writes: > > I guess Joe Armstrong (of Erlang fame) would have to say a lot about how to > deal with failure properly. According to him, and the seemingly successful > Erlang philosophy (which is, "let it crash"), attempts to locally handle > errors are exactly the wrong approach. See his very insightful thesis. This is close to one of the rules related to errors in Kernighan & Pike's excellent book "The practice of programming" (http://cm.bell-labs.com/cm/cs/tpop/), which is # Detect errors at a low level, handle them at a high level. I always try to follow this rule and it appears to be a very good one. And regarding exceptions specifically, another of their rules is this one: # Use exceptions only for exceptional situations. -- Jean-Christophe