coding standards - spaces inside parenthesis

The Wordpress coding standards states to put spaces both inside and outside opening and closing parenthesis.What is the

The Wordpress coding standards states to put spaces both inside and outside opening and closing parenthesis.

What is the rationale behind spaces on the inside of parenthesis? I've hardly ever seen that in any other code except PHP.

The Wordpress coding standards states to put spaces both inside and outside opening and closing parenthesis.

What is the rationale behind spaces on the inside of parenthesis? I've hardly ever seen that in any other code except PHP.

Share Improve this question edited Nov 14, 2019 at 19:40 AFOC 1133 bronze badges asked Apr 13, 2013 at 14:07 ivviivvi 6694 gold badges10 silver badges22 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 5

This is mostly just for readability. The semantics change before and after a parenthesis, and we are used to read spaces as word separators in western languages, so we can read such code faster.

Another point is search: If you want to search for all changes on variables beginning with $post it is easier to write a regex when you know there is always a space before and after. Doesn’t make a big difference, but still …

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745003353a4605632.html

相关推荐

  • coding standards - spaces inside parenthesis

    The Wordpress coding standards states to put spaces both inside and outside opening and closing parenthesis.What is the

    1天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信