Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82692 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31887 invoked from network); 14 Feb 2015 15:43:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2015 15:43:11 -0000 Authentication-Results: pb1.pair.com header.from=ralph@ralphschindler.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ralph@ralphschindler.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ralphschindler.com from 209.85.214.177 cause and error) X-PHP-List-Original-Sender: ralph@ralphschindler.com X-Host-Fingerprint: 209.85.214.177 mail-ob0-f177.google.com Received: from [209.85.214.177] ([209.85.214.177:63106] helo=mail-ob0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5D/64-03565-D0D6FD45 for ; Sat, 14 Feb 2015 10:43:10 -0500 Received: by mail-ob0-f177.google.com with SMTP id wp18so28500593obc.8 for ; Sat, 14 Feb 2015 07:43:07 -0800 (PST) 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=iWxUfUr6IRGmd9/grD7hNN+NOdbU5OSQcW+/k4o6fn0=; b=JHn/P3zMv1jGKB3XKd9IUTEIgKLC3m+raKVCBecpyImUgvoYqsc1mEboC8MB0xJSbW G/HTiYHgoRZ4958/dRAv/cqe5ddffX570GhXFx07QkDNYzkBCSQ8jTPC3RwV7OrW7HKR dDmWGqKVpKq9MxPSZ9XK/ObJKcIvH5INWAqs/nuxdlOwwVjx4ujuuIxIHB1wC1liSwyH td8kVyaZ1FfhwKBXmL/05cDXGFChT3xxCfDHg81WhjWKdBncC6Egb2B8IGN4cF7OB4Dw luE7Lw6n3tAphMcQwq7FFX7qKmCoCBPV0FGh52gIobXLHxbGbGjEHfzRqwlnqyzw7kGH K6Zg== X-Gm-Message-State: ALoCoQlC3F5t0kI3T9POulQPucsnWGGzAVrJIcu/Hn7Ps6jB8SBPEfmEkHarEdOYsAwj9tOTBzwm X-Received: by 10.182.56.165 with SMTP id b5mr10233365obq.4.1423928587301; Sat, 14 Feb 2015 07:43:07 -0800 (PST) Received: from [172.16.1.4] (ip72-211-83-231.no.no.cox.net. [72.211.83.231]) by mx.google.com with ESMTPSA id h8sm553782obe.2.2015.02.14.07.43.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Feb 2015 07:43:06 -0800 (PST) Message-ID: <54DF6D09.30102@ralphschindler.com> Date: Sat, 14 Feb 2015 09:43:05 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: PHP internals References: <54DE7DD8.5060004@ralphschindler.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV][RFC][VOTE] Group Use Declarations From: ralph@ralphschindler.com (Ralph Schindler) > 1. We aimed for maximum readability. The block syntax delimited with > bracket `{` ... `}` pairs is definitely easier to keep track in > comparison with a colon and semicolon `:`...`;` > > 2. A block delimited by a double colon and a semicolon `:` `;` is NOT > yet part of any structure from the PHP. Introducing a brand new element > on the syntax, when bracket delimited blocks `{` ... `}` are already a > pervasive structure on the language, seems unnecessary, specially > considering the previous analysis on loss of readability. Almost all the most used control structures have an alternative way of being delimited with a colon/semicolon blocking: http://php.net/manual/en/control-structures.alternative-syntax.php The difference is that what I proposed did not have an end-token, like endforeach, endwhile, etc. I think what you mean though is that the alternative syntax is not pervasive in _declaration_ structures, which is true. > 3. This idea also implies a distinct syntax for namespace fragments: > "PhpParser\Node\Stmt:" while least effort approach, that offers the > least cognitive effort to the user land, is to simply have namespace > fragments with a trailing "\" as in "PhpParser\Node\Stmt\". > > 4. The paired brakets `{` ... `}` proposal stays on the comfort zone > from users already used to C-syntax language family. Introducing a colon > and semicolon to delimit a list in PHP would be new bits. I'd prefer to > build such a feature upon conservation of current PHP style. > > These are the my thoughts around your suggestion in comparison with the > proposed syntax on the RFC. Perhaps you have something else to add? :) The cognitive switch is going to have different impacts on different people. While a nit-pick, I see \{ as an escape sequence (yes, I know this was an argument with namespaces, but at least those always follow with a letter) and causes a slight deficiency in readability for me, but I realize it has been proposed to not have a \ at the end of the used name. -ralph