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.
You must be logged in to post a comment.
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 â¦