[wp-hackers] Coding style

Brian Layman Brian at TheCodeCave.com
Tue Jul 4 01:52:52 GMT 2006

> This is a religious thing for some folks.  I prefer spaces myself, but

> tabs is the WP standard.  So, to head off a long tabs vs. spaces
> tabs is here to stay. :-)
Lol Yeah - it all goes back to how you were first taught - and how much
Fortran77 you did...
I concede this has no chance of changing.  
I even said, it's got the much of weight of the WP code base going
against it.

>> 5. If at all possible, omit curly braces.
>For my personal code, I prefer to keep the curly braces.  But, most WP 
>code omits them so we might as well make it official.  
Text searching for "} else {"  and hex searching for "65 6C 73 65 0A"
reveals that you're probably right on that.  But there are a number both
ways.  As long as they are indented consistently, the second way doesn't
bother me.  It's just too easy to have the wrong indentation.

> Maybe we need a style guide and a best practices guide.  Best
> such as use js_escape() when putting arbitrary data in an onclick.

Good, idea.

More information about the wp-hackers mailing list