Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82711 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84431 invoked from network); 15 Feb 2015 00:11:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Feb 2015 00:11:02 -0000 Authentication-Results: pb1.pair.com header.from=marcio.web2@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=marcio.web2@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.177 as permitted sender) X-PHP-List-Original-Sender: marcio.web2@gmail.com X-Host-Fingerprint: 209.85.217.177 mail-lb0-f177.google.com Received: from [209.85.217.177] ([209.85.217.177:39205] helo=mail-lb0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 06/23-00421-514EFD45 for ; Sat, 14 Feb 2015 19:11:02 -0500 Received: by mail-lb0-f177.google.com with SMTP id z11so21511221lbi.8 for ; Sat, 14 Feb 2015 16:10:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=UtyMzsvsItV4ge34mndmrJ5IHXsrR7z41NB8ZZNava0=; b=tiZOPJ206rLVtihV5UEMFRHUoMUipuuVbGOFD09MB7I2mfw+rf0OmWTiztJ+WIVxWY xGNAzY+YVMveUhY4y9ky/BcLSdXLf5b0JXB8ig1KX30v8lTlrqv6zMhFkQxZmMVRBy4/ AfIFeoYPSSHzMhhss7ub38s8pU01sI1qEAPugpxoERcEC/RjKxAPvY0Hb6UVSpL/giOT kQtVTqGrP+tp+R0NBQqWSmMz+hAijKZ5ExBps03r83Xm4u3eDor1nR42eAZrzF7bpEZx CEgVcdcbDbH5y7J+igqS7Zy135caNH9NKuqqCcWddMskxy+avYEPHUh8juxvLanC+GNG da+A== X-Received: by 10.112.188.227 with SMTP id gd3mr14899348lbc.22.1423959058067; Sat, 14 Feb 2015 16:10:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.152.21.101 with HTTP; Sat, 14 Feb 2015 16:10:36 -0800 (PST) Reply-To: marcio3w@gmail.com In-Reply-To: <54DF6D09.30102@ralphschindler.com> References: <54DE7DD8.5060004@ralphschindler.com> <54DF6D09.30102@ralphschindler.com> Date: Sat, 14 Feb 2015 21:10:36 -0300 Message-ID: To: Ralph Schindler Cc: PHP internals Content-Type: multipart/alternative; boundary=001a11c36aa8d4b5e1050f154d62 Subject: Re: [PHP-DEV][RFC][VOTE] Group Use Declarations From: marcio.web2@gmail.com (Marcio Almada) --001a11c36aa8d4b5e1050f154d62 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, Ralph 2015-02-14 12:43 GMT-03:00 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. > > Ralph, you are right about point 2. I should have been more specific. BTW, I still think it's weird not to have an end token on your suggestion. It makes sense on it's own, but taking PHP as context the proposed syntax on the RFC has more advantages. > 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 th= is > 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 reali= ze > it has been proposed to not have a \ at the end of the used name. Yes, there is a voting option for not having a trailing "\". FYI, if you care enough to read the changelog, the very first draft used the no trailing "\" variant of the syntax. Turns out that many people pointed that there is already a design convention to use a trailing namespace separator before the glob braces on other languages. For instance, Rust language: import a::b::{c, d, e, f} Thanks, M=C3=A1rcio Almada -ralph > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a11c36aa8d4b5e1050f154d62--