Coding Standards Summary of the last Week

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):

  1. This is more about applying the current standard than switching to a new one or adding new stuff.
  2. 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.
  3. Improvements to the code can be simply provided as a patch in #11971.
  4. 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.
  5. A single file should be provided containing correct usage, it can be more easily overlooked.
  6. 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.
  7. PHP files are closed having an ?> at the end (despite the critique).
  8. 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.

Previous: WordPress Coding Standards – How to go on? (18 Jan 2010; by hakre)
Follow Up: PHP Code Sniffer, Eclipse and WordPress (6 Mar 2010; by hakre)

This entry was posted in Hacking The Core and tagged , , , , , , . Bookmark the permalink.

4 Responses to Coding Standards Summary of the last Week

  1. Pingback: Docblock comments and more in code guidelines / standards « hakre on wordpress

  2. Pingback: Coding Standards that ain’t one | hakre on wordpress

  3. Pingback: WordPress Coding Standards – How to go on? | hakre on wordpress

  4. Pingback: PHP Code Sniffer, Eclipse and Wordpress | hakre on wordpress

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.