Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69779 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61869 invoked from network); 22 Oct 2013 19:13:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Oct 2013 19:13:13 -0000 Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 74.125.82.170 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 74.125.82.170 mail-we0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:49497] helo=mail-we0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 86/7B-10840-74EC6625 for ; Tue, 22 Oct 2013 15:13:13 -0400 Received: by mail-we0-f170.google.com with SMTP id u57so8700067wes.15 for ; Tue, 22 Oct 2013 12:13:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=uB9knYVgVvCyFHbQDRUhIjqhu5ABTkm39n7spYCFvXg=; b=dLcpmoX0kl1heCpct1IbTwvmwe8RjYupyuFD688FjgxA9kLIxVQbJomFvU7c4TYmdS bbPO/PFsI+R2Bsq6Jws0pefqceOfQakaYVoz2ciQJUO1uXna+YXYjistBf4g8hxplO46 VP4YP46k+55GsHVikARkyLtRF9C6AUAsP+rsjEJX5dbbpPgx1XgV8xt0sBz9z7dvwOw9 0cO3CXZTbGUERrrCX54gqCqHPLe4QywpfXH1cgNzWL0AqNcAJIy2YgnWROkgXr6Tqn/t Hfsktq393qrZ0yfK4PYwQlvEBXhaml7vIrffJlG9CFmRv9Jw6Wp9QI/dKdr6qYJ8S6QC OkQg== X-Gm-Message-State: ALoCoQkTSqJ9dUUUWG/z2p+dgchltxmOgXjXESTkBPlEP81pBZauki8xlydX9/vTLPV6OYZ0rFA0 X-Received: by 10.194.118.198 with SMTP id ko6mr26720wjb.90.1382469189234; Tue, 22 Oct 2013 12:13:09 -0700 (PDT) Received: from [192.168.0.3] (cpc22-asfd3-2-0-cust209.1-2.cable.virginm.net. [80.4.21.210]) by mx.google.com with ESMTPSA id jf2sm9321612wic.2.2013.10.22.12.13.06 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 22 Oct 2013 12:13:08 -0700 (PDT) Message-ID: <5266CE3F.8050505@pthreads.org> Date: Tue, 22 Oct 2013 20:13:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Patrick Schaaf , internals@lists.php.net References: <3D.BC.23638.84CA1625@pb1.pair.com> <5264FE65.8050808@php.net> <5266B6A8.4010607@pthreads.org> <5266BECD.8000204@php.net> <5266C83C.1060200@php.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC: Expectations From: pthreads@pthreads.org (Joe Watkins) On 10/22/2013 07:59 PM, Patrick Schaaf wrote: > > > > Production code should _NOT_ have catch blocks everywhere to manage > exceptions that will NEVER be thrown, obviously. > > > > assertion is a debug and development feature, if you take code to > production that catches exceptions that your configuration does not > allow to be thrown then that's pretty silly. > > Ah so you would only add such catch blocks during development, after > you've seen an assertion. Similar to how I'm used to add logging > (printf style debugging for C programmers) in suitable places. > > ... > > best regards > Patrick > Yes, definitely. I assumed this was clear; it's not a replacement for normal logic, it's a debugging and development aid, just like everywhere else. catch() here is no added fat, we don't need to do anything, especially anything that affects production in order to provide a decent way of debugging the failure, using the stack trace, accessing the scope, all on a designated code path. Failed assertions are a sign of broken programming, not a sign to take a different code path during execution, but a sign that development must go on a little longer :) Cheers Joe