> 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 <larue...@php.net> 
Sent: Wednesday, May 6, 2020 6:20 PM
To: Christoph M. Becker <cmbecke...@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 <cmbecke...@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/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to