Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67857 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 760 invoked from network); 26 Jun 2013 11:54:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2013 11:54:24 -0000 Authentication-Results: pb1.pair.com header.from=joost.koehoorn@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=joost.koehoorn@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.45 as permitted sender) X-PHP-List-Original-Sender: joost.koehoorn@gmail.com X-Host-Fingerprint: 74.125.82.45 mail-wg0-f45.google.com Received: from [74.125.82.45] ([74.125.82.45:52362] helo=mail-wg0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F6/13-18025-F66DAC15 for ; Wed, 26 Jun 2013 07:54:24 -0400 Received: by mail-wg0-f45.google.com with SMTP id j13so10232420wgh.0 for ; Wed, 26 Jun 2013 04:54:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:message-id:in-reply-to:references:subject:x-mailer :mime-version:content-type:content-transfer-encoding; bh=wa3kGcWYsUm1DEmqQWbRye75OGs8Ljm9FRPlM61eMqA=; b=vHB0yWkBAtVgp9CbSllgw3QEVprJ0+Cs37JBlnagXsIvlS1jcdU6VrfTpBjKYInpnw d/7dHDd2KG8enCJxAbPg+yIg3HMSkXLJ9M/hXv2wl0PzpoM2b68xzNf3EJfX0O2NmVx2 +VHZMGg4x+OBGAHTxyf61QvmdnQxboLcbGVlWs+89Vop+E0m8Wby7bvhB/vW3qfQ8Rgy 5lPcPvuy5+1gedKcTr9i4mnwv62HtoQ7MHs+ugw7WyhQ4UBYHu/7yas6Eq6rlLHxVSWz pfTC3asEWNNEimbqSIlrTx3rJ0t/rC5T1ZQ4++dDsOTTWtfgz2s3NUCpssf1da5HRaYE u+pg== X-Received: by 10.180.205.200 with SMTP id li8mr2395417wic.15.1372247660429; Wed, 26 Jun 2013 04:54:20 -0700 (PDT) Received: from MacBook-Air-van-Joost-Koehoorn.local (178-85-180-81.dynamic.upc.nl. [178.85.180.81]) by mx.google.com with ESMTPSA id p1sm10279777wix.9.2013.06.26.04.54.18 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 26 Jun 2013 04:54:19 -0700 (PDT) Date: Wed, 26 Jun 2013 13:54:18 +0200 To: Michael Wallner , =?UTF-8?Q?Johannes_Schl=C3=BCter?= Cc: Stas Malyshev , Sherif Ramadan , "=?UTF-8?Q?internals=40lists.php.net?=" Message-ID: In-Reply-To: References: <4ED7146272E04A47B986ED49E771E347BB4DF6F235@Ikarus.ameusgmbh.intern> <51C9DED2.5080401@sugarcrm.com> <51C9F485.6050709@sugarcrm.com> <51C9FB61.3050903@sugarcrm.com> <1372191793.2389.80.camel@guybrush> X-Mailer: Airmail Beta (183) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: =?UTF-8?Q?Re=3A_=5BPHP-DEV=5D_RE=3A_Announcing_RFC_'Anonymous_Catches'?= From: joost.koehoorn@gmail.com (Joost Koehoorn) On 26 juni 2013 at 08:35:59, Michael Wallner (mike=40php.net) wrote: On 25 June 2013 22:23, Johannes Schl=C3=BCter = wrote:=C2=A0 > On Tue, 2013-06-25 at 13:19 -0700, Stas Malyshev wrote:=C2=A0 >> Hi=21=C2=A0 >>=C2=A0 >> > If I'm to understand this R=46C correctly, it is nothing more than a= =C2=A0 >> > random suggestion someone posed in the form of a tweet and the autho= r is=C2=A0 >> > saying why not add it since it's not hard to implement. So in summat= ion=C2=A0 >>=C2=A0 >> Well, here we go - this is why not add it, because it makes working wi= th=C2=A0 >> such code harder without actually benefiting anybody.=C2=A0 >=C2=A0 > +1=C2=A0 >=C2=A0 > Right now I set a breakpoint in my editor and look at an exception even= =C2=A0 > if it is not used, in future I'd have to change the code for that.=C2=A0= Hrm, this is a very good point=21=C2=A0 >> > So this entire discussion can be summed up nicely with =22Let's make= the=C2=A0 >> > variable optional because... why not=3F=22.=C2=A0 >>=C2=A0 >> =22Why not=22 is usually not a very good principle of language design,= IMO.=C2=A0 Nothing more to add.=C2=A0 --=C2=A0 Regards,=C2=A0 Mike=C2=A0 This is a little pathetic. Someone sums it up to =22Why not=22, which is = not the case, we have grounded arguments for this, and then all agree tha= t =22Why not=22 is not a reason to add something. Surely it isn't. You mention bad coding practices. Sure, we should avoid them. Unused vari= ables is a bad coding practice. So, we should avoid them. Luckily, it's e= asy to avoid them with catch-statements, because we can simply make the v= ariable optional. I recently wrote a CLI tool in C=23 to import data from Team =46oundation= Server. During an update, I try to download every new commits from where= I last stopped (so, from commit =22latest+1=22). That fails with a Chang= esetNot=46oundException when no such commit exists, fair enough. I cannot= test beforehand whether that exception will be thrown (that would mean I= needed two calls to the server, now it's in one round) so it's totally e= xpected. I'm doing this for 100.000 files and I don't want to do anything= with the exception, it's nothing more than an indication that we're alre= ady up-to-date for that file. Done. In PHP I would have an unused variabl= e, which trips up my static analysis tool that keeps warning me about the= bad coding practice of having an unused variable. I agree, it's bad to h= ave that variable defined but PHP won't let me get rid of it. Another rea= son for people to bitch about PHP. Luckily, we can do something about it, and it happens to be easy.