[wp-hackers] Coding style

Owen Winkler ringmaster at midnightcircus.com
Tue Jul 4 02:17:06 GMT 2006


Brian Layman wrote:
> Now, if I couldn't find anywhere that the standard was broken in the WP
> code, it would only be stronger that it is a standard that SHOULD be
> followed in future code and thus noted on the Coding Styles page.
> 
> But if you do want examples of where it is not followed, here are the
> first few that I've found:
...
> Plugins have them too...
> buttonsnap.php
> function TinyMCE_buttonsnap_parseAttributes(attribute_string) {
>    var attributeName = "";
>    var attributeValue = "";
>    var withInName;
>    var withInValue;
>    var attributes = new Array();
>    var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g');
>    var titleText = tinyMCE.getLang('lang_buttonsnap_more');
>    var titleTextPage = tinyMCE.getLang('lang_buttonsnap_page');

Nice example use of PHP syntax being incorrectly applied to Javascript.

A discussion on coding syntax isn't going to be constructive.  Unless 
someone has a correction to make in the syntax docs, ("You forgot a 
brace there.") then let's just say that those guidelines that are 
written reflect what we are already using, and then continue in that 
direction.

Owen





More information about the wp-hackers mailing list