Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66645 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48039 invoked from network); 15 Mar 2013 14:44:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Mar 2013 14:44:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=markg85@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=markg85@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.171 as permitted sender) X-PHP-List-Original-Sender: markg85@gmail.com X-Host-Fingerprint: 209.85.220.171 mail-vc0-f171.google.com Received: from [209.85.220.171] ([209.85.220.171:50073] helo=mail-vc0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/D1-59234-FB333415 for ; Fri, 15 Mar 2013 09:44:16 -0500 Received: by mail-vc0-f171.google.com with SMTP id ha11so1287821vcb.16 for ; Fri, 15 Mar 2013 07:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=2pZBarbdaYKSWqC7TzdFIUgfWUw9fxsqn+ZPXWxNsDk=; b=FkfuOGcJPlM0kka+mS00B93mnLbxXli9LWbvEj19tIHaX9wM4MXULmKrYQoBjVh1aI p3N0AcEPeAVXxjrFHHfr1hdQbm8Ju4GDGTrKXtK5Tgh4fK1CiCX7Otq9dQX0cbCuaR5N 0MLBpR4HvBhEyHzNAnwdmVoL8Hh7P9yr4qdN2t0/kW7RjPWhrpyttJIvEx6shGHgNvcv FIRn4IF/niclcQaYCqc4PdYapMK191KKyEYnzSJJwvpcZXgtH+5Dav8xi4wqw/bY1I1x 9DgCEPiSWJ8hus/TI6VJTV2JujETUzjhRx2S73mNsZCol5Gw464EWYMgGD6xHYE2KXZD DV1Q== X-Received: by 10.52.76.164 with SMTP id l4mr6227249vdw.122.1363358653277; Fri, 15 Mar 2013 07:44:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.244.67 with HTTP; Fri, 15 Mar 2013 07:43:53 -0700 (PDT) In-Reply-To: <512B5668.2060508@zerocue.com> References: <8490FC41-2696-4948-83A1-3931674183B0@gmail.com> <288800174.20130220052301@cypressintegrated.com> <14B2EAAC-0B40-44C2-84E8-99B89C7398D0@gmail.com> <512B5668.2060508@zerocue.com> Date: Fri, 15 Mar 2013 15:43:53 +0100 Message-ID: To: Clint Priest Cc: David Muir , Lazare Inepologlou , Sanford Whiteman , "internals@lists.php.net" Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [RFC] Short syntax for anonymous functions From: markg85@gmail.com (Mark) On Mon, Feb 25, 2013 at 1:17 PM, Clint Priest wrote: > > On 2/21/2013 5:17 AM, David Muir wrote: >> >> On 21/02/2013, at 6:12 AM, Lazare Inepologlou wrote: >> >>> >>> Long code is not always equivalent to readable code. A shorter syntax >>> could >>> improve readability in *some* cases. >>> >>> Long: >>> $users->OrderBy( function( $x ){ return $x->Surname; } ); >>> >>> Short: >>> $users->OrderBy( $x ==> $x->Surname ); >>> >> I think your example proves the opposite. The fist example was much easier >> to read and understand than the second. > > That all depends on how many languages you're versed in, the short syntax > above is common in many modern languages and has no clarity issues for me. > > > -- > -Clint > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > Just letting my voice hear as a "php developer" watching this list from time to time. As a php developer i'm heavily against adding this "feature" to php. It makes the code very vague to understand and specially if it's spread over multiple files. For example file_a.php has: $sayHi = { echo "hi"; }; Now lets say file_b.php has this: $sayHi(); This is just code obfuscation! Please don't add it. It would be neat as a code obfuscation technique :) Just my 5 cents. Cheers, Mark