Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110094 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 48360 invoked from network); 8 May 2020 22:00:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 May 2020 22:00:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 597411804D3 for ; Fri, 8 May 2020 13:36:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FROM_EXCESS_BASE64, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS132203 203.205.194.0/23 X-Spam-Virus: No X-Envelope-From: Received: from smtpproxy21.qq.com (smtpbg702.qq.com [203.205.195.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 8 May 2020 13:36:15 -0700 (PDT) X-QQ-mid:Yeas5t1588970168t579t41561 Received: from 4B562073492C4058817F84E016DE3445 (me@jhdxr.com [116.14.113.108]) X-QQ-SSF:00100000000000F0FG1000000000000 To: "'Xinchen Hui'" , "'Christoph M. Becker'" Cc: "'PHP internals'" References: In-Reply-To: Date: Sat, 9 May 2020 04:36:07 +0800 Message-ID: <004f01d62578$4d3e9aa0$e7bbcfe0$@jhdxr.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Content-Language: zh-cn Thread-Index: AQGf5HctSx3WRHIqjS94u5bBR3MABgB1kRLwqQd5EYA= X-QQ-SENDSIZE: 520 Feedback-ID: Yeas:jhdxr.com:qybgforeign:qybgforeign6 X-QQ-Bgrelay: 1 Subject: RE: [PHP-DEV] Update coding standards wrt. C99? From: me@jhdxr.com (=?utf-8?b?Q0hVIFpoYW93ZWk=?=) > IMO, mixing variables and codes are always not a good practice I think it depends. For example, modern languages recommend to declare i = inside the for loop block instead of in the function block.=20 -----Original Message----- From: Xinchen Hui =20 Sent: Wednesday, May 6, 2020 6:20 PM To: Christoph M. Becker Cc: PHP internals Subject: Re: [PHP-DEV] Update coding standards wrt. C99? Hey: On Wed, May 6, 2020 at 3:32 PM Christoph M. Becker wrote: > Hi all, > > since master requires (mostly) C99 compliant compilers anyway, I=20 > wonder if we like to update our coding standards[1], to reflect: > > * that we require (mostly) C99 compliant compilers (instead of ANSI-C = > compliant compilers) > > * that mixing of declarations and statements is fine > IMO, mixing variables and codes are always not a good practice, strict = is always means tidy.. mixing declarations and codes sometimes brings unexpected varaibles = overriden and hard to debugging. and, I don't think make variables declaration at top of a block is a = hard thing to do. thanks > * that C++ style comments are now allowed, or maybe that they are=20 > still forbidden (in the latter case the stated reasons should be=20 > updated) > > We may also consider to drop the "Documentation and folding hooks"[2]=20 > section; besides that it is already partially outdated (AIUI,=20 > doc/genfuncsummary is superseeded by doc/docgen for a long time), I=20 > don't think these folding markers encapsulating each individual=20 > function are useful nowadays. > > Thoughts? > > [1] > [2] > < > https://github.com/php/php-src/blob/master/CODING_STANDARDS.md#documen > tation-and-folding-hooks > > > > -- > Christoph M. Becker > > -- > PHP Internals - PHP Runtime Development Mailing List To unsubscribe,=20 > visit: http://www.php.net/unsub.php > -- Xinchen Hui @Laruence http://www.laruence.com/