Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65969 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93654 invoked from network); 19 Feb 2013 16:46:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2013 16:46:26 -0000 Authentication-Results: pb1.pair.com header.from=mduarte@inviqa.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=mduarte@inviqa.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain inviqa.com from 74.125.82.170 cause and error) X-PHP-List-Original-Sender: mduarte@inviqa.com X-Host-Fingerprint: 74.125.82.170 mail-we0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:61066] helo=mail-we0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 98/9E-17768-06CA3215 for ; Tue, 19 Feb 2013 11:46:26 -0500 Received: by mail-we0-f170.google.com with SMTP id z53so5773168wey.15 for ; Tue, 19 Feb 2013 08:46:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:subject:mime-version:content-type:from:in-reply-to:date :cc:content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=u/cYuXNprnkkBpE4U02y4FfaairQoNOOMSvHY5sZD8w=; b=kT+TBCR2Kh9VnWjGTFuYmqnT8Hr/PjS/kt4N8E+5Lo9RMnVEddyvAeqKYyRa/P04Gr 326he8ZdLzW6OnShTQLnmG/QHYotlvmlN8ZStz6p4Oc0eHJ16mIZCmqU7b/8FHMuvz0X IJFP2ZtZjXYniYAM7WX9H+j1ulGOY2wBOogPT8pHJDRqJzx8GBQgRJTM61uXVjwoYylC jR6pjry4eBDCMAdtO7HlYNRQFpCgkS1lq/wO131GU7797W5rhjyJMTAgwGlSw7VOCTbU eV9G3iCOCrpRXKFXFMWhIoqUAWkQ9BrhhAP98eFCyn+H4PrhR++fe34TDbynZyw5KdU0 ZcTQ== X-Received: by 10.194.161.135 with SMTP id xs7mr27848470wjb.41.1361292381625; Tue, 19 Feb 2013 08:46:21 -0800 (PST) Received: from [192.168.2.6] (cpc11-finc13-2-0-cust737.4-2.cable.virginmedia.com. [82.1.90.226]) by mx.google.com with ESMTPS id bj9sm26571503wib.4.2013.02.19.08.46.20 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Feb 2013 08:46:20 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=windows-1252 In-Reply-To: Date: Tue, 19 Feb 2013 16:46:18 +0000 Cc: PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <8490FC41-2696-4948-83A1-3931674183B0@gmail.com> <3EBB0AF2-A114-4652-806B-C50DD8F9557D@inviqa.com> To: Leigh X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQkQNBHJF9Uzy10CmUvkEjZoFsI48IN4DFEt0IVkmsweI8WAEdMJ5sMwrqA/A/qvSRurFAsJ Subject: Re: [PHP-DEV] [RFC] Short syntax for anonymous functions From: mduarte@inviqa.com (Marcello Duarte) On 19 Feb 2013, at 14:16, Leigh wrote: >>=20 >>=20 >> I can understand that If you haven't tried to write a tool like >> capistrano, rspec, chef, puppet, etc, etc in PHP you probably won't = see >> much value in implementing such things. >>=20 >>=20 > Your RFC doesn't go to great lengths to explain the value either. = Pretend > the reader has no experience with any of those tools you mention, = pretend > the only language they know is PHP, please explain where the value for = this > syntax is in PHP? Very good feedback. Very much appreciated. I will see if I can expand on = what I have that. Thank you. > I find the existing syntax easy to understand. I find the proposed = syntax > disproportionally difficult and unintuitive in relation to any benefit = it > is supposed to give. >=20 >=20 >> What is superfluous for is useful for other users. It would be useful >> building DSL. At my company we use loads of ruby tools for deploying, >> provisioning, etc. just because of the DSL they provide. The array = short >> syntax was great news. Adding a short syntax for closures would make = it >> possible to write such scripts in PHP =96 where the syntax would not = stand on >> its way. >>=20 >>=20 > >=20 > If Ruby is the right tool for the job, and PHP is not the right tool = for > the job, the answer to which language to use seems obvious right? I find that more and more my developers have to learn ruby just to be = able to work in our projects. We are one of the largest PHP shops in = Europe and even the proprietary tools we are writing for DevOps stuff we = are writing in Ruby. This small syntax arrangement would make it = possible to write DSLs in PHP. The result is that I can have my PHP = developers focusing on one language only and get the job done. The = problem of the web is a bit more complex now, if you look on all you = need to develop and deploy a large PHP application. > I disagree wholeheartedly that this proposed syntax would make code in = any > way more readable, or maintainable. Please understand that there is a difference between code you write and = other people maintain, and code you write for other people to use. The = purpose of this feature is focused on the later, to allow the = construction of DSLs, so users of your code can focus on the task at = hand. -- Marcello Duarte=