Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86805 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10378 invoked from network); 23 Jun 2015 09:19:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jun 2015 09:19:14 -0000 Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.213.54 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.213.54 mail-yh0-f54.google.com Received: from [209.85.213.54] ([209.85.213.54:33841] helo=mail-yh0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/10-09700-C8429855 for ; Tue, 23 Jun 2015 05:19:13 -0400 Received: by yhnv31 with SMTP id v31so1372610yhn.1 for ; Tue, 23 Jun 2015 02:19:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=9JcdFNaykHWKxw8BVo1UJATn94G5F3yhcEMr8+Z3cEQ=; b=Ehx+35ujw/UZwnoLQGWML2T1Ub5JW1UPJhNbKif+SGj7C9kRWXfAT2Fs7l/86Qb7qt xex8XbTk3oWJT4dzQC1KEpp4naUOidtvOiKGuCcq0phlT0HfPjuO1tJfRuliE7ZrjaOH 4LnqMMtC9kg23yQnNYnOzE9G8ygWMrHIpca+Ru5UGSIbPs9KfkUEe8be/BD/bjseDWFt qQKJbCMZKf+9enniKvkno2dck4+qpzFu3w2iI16NkNS2Xj9s72OMKGXCtqI8c4gOlVU4 Z2xczEReJm5MlUEn4n3NXmKltvVg6n7ZOA/CUlZOYZMUwiLkzBGzpbKakdtctSmFSgmd Fy4w== X-Gm-Message-State: ALoCoQl4ngDcnHc1h9EVOdqjjOgoAw9RwwsMIpYKZwaWEn7mZLrBYPuJXGLfc1iV2FyI2tb5IKp2 MIME-Version: 1.0 X-Received: by 10.170.35.196 with SMTP id 187mr29674478ykd.121.1435051144835; Tue, 23 Jun 2015 02:19:04 -0700 (PDT) Received: by 10.37.215.15 with HTTP; Tue, 23 Jun 2015 02:19:04 -0700 (PDT) X-Originating-IP: [90.51.106.43] In-Reply-To: References: Date: Tue, 23 Jun 2015 09:19:04 +0000 Message-ID: To: Kevin Bradwick Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] RFC - making the Exception class abstract From: danack@basereality.com (Dan Ackroyd) Hi Kevin, Kevin Bradwick wrote: > Too many times have I seen developers throwing Exceptions when what they > really needed was something that gave it context like > InvalidArgumentException or RuntimeException. > > Yes, I agree this is something to tackle at code review (and I do) but > I feel PHP doesn't help the situation by making it an instantiatable class. In general I don't believe making a language be harder to use is the correct solution for programmers doing things you don't like. Designing a language should be focussed on enabling people to write good applications, rather than trying to force a baseline of adequacy. In particular for this case: * Bad programmers would just switch to using another 'default' Exception such as ErrorExcepton. * Good programmers who usually use a specfic exception, but in some scenario want to use an \Exception sensible reasons would just be inconvenienced. So to me, it seems this would only have downsides with no real upside. > Is it worth me pursing the RFC with full > details of the idea or am I on my own with this one? If you did want to proceed with it, I think you would need to address how much BC break it would cause, and why it would be worth it. cheers Dan