The last week gave us some more feedback regarding the wordpress coding standard. In general the current standards seems accepted, but some areas were highlighted in comments where problems might arise with the current definition (this list is also a try to get that into order, the most important on top):
- This is more about applying the current standard than switching to a new one or adding new stuff.
- The biggest problem next to the fact that the standard is not well defined is that it isn’t applied to the codebase in full.
- Improvements to the code can be simply provided as a patch in #11971.
- It was said, if there is a problem in the documentation, that should be fixed. Rules must be simplified and clarified. The standard should not be that complex, and easy to adopt.
- A single file should be provided containing correct usage, it can be more easily overlooked.
- Current bracket (the round ones) usage is questioned/not well defined for functions with or w/o arguments or for certain type of functions (i.e. translation). Additionally, in the code this has not been handeled consequentially as well as in the mailing list email (the documented root of the wordpress coding standard) is describing bracket usage differently to the codex page. So this is a point to be clearly defined and applied. It might be at error on the codex page.
- PHP files are closed having an ?> at the end (despite the critique).
- There are more topics, but improvements should be applied step by step to go further.
This is a first summary. Relating to the current standard, there was only little feedback given about what it is good for / not good for in it’s general usage over the years. This can be related to the topic or to the concrete standard, I can not say.
Additionally the files that are linked in from third party projects (external libraries that ship with wordpress) should be tagged to not being changed due to coding standards because they are not part of the project. For example, adopting the SimplePie sources to the wordpress coding standards is hard to imagine at all.