RE: [PHP-DEV] Update coding standards wrt. C99?
| From: | CHU Zhaowei | Date: | Fri, 08 May 2020 20:36:07 +0000 |
| Subject: | RE: [PHP-DEV] Update coding standards wrt. C99? | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-110094@lists.php.net to get a copy of this message | ||
> 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.
-----Original Message-----
From: Xinchen Hui <laruence@php.net>
Sent: Wednesday, May 6, 2020 6:20 PM
To: Christoph M. Becker <cmbecker69@gmx.de>
Cc: PHP internals <internals@lists.php.net>
Subject: Re: [PHP-DEV] Update coding standards wrt. C99?
Hey:
On Wed, May 6, 2020 at 3:32 PM Christoph M. Becker <cmbecker69@gmx.de>
wrote:
> Hi all,
>
> since master requires (mostly) C99 compliant compilers anyway, I
> 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
> still forbidden (in the latter case the stated reasons should be
> updated)
>
> We may also consider to drop the "Documentation and folding hooks"[2]
> section; besides that it is already partially outdated (AIUI,
> doc/genfuncsummary is superseeded by doc/docgen for a long time), I
> don't think these folding markers encapsulating each individual
> function are useful nowadays.
>
> Thoughts?
>
> [1]
> <https://github.com/php/php-src/blob/master/CODING_STANDARDS.md>
> [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,
> visit: http://www.php.net/unsub.php
>
--
Xinchen Hui
@Laruence
http://www.laruence.com/