[wp-hackers] Coding style

Brian Layman Brian at TheCodeCave.com
Mon Jul 3 21:32:03 GMT 2006


> http://wordpress.org/docs/developer/coding-style/
> "Use real tabs and not spaces, as this allows the most flexibility across
clients."

I know you weren't asking for debate, but I HATE this rule!!!  I prefer a
quick two spaces to PEAR's four, but any number of spaces less than 8 would
be infinitely preferable to the use of Tabs, which are handled
inconsistently between many Linux, Windows and PocketPC apps, not to mention
browsers.  PEAR seems to handle development with spaces across a wide number
of clients without difficulty.  Additionally, with TABs, once you are only
four levels deep, in most standard Windows editors, you are already most of
the way across the page before the code starts.  It makes any complex code
VERY difficult to read.  I don't see why WP requirements should be any
different than PEAR's in this area.

I know this has the whole weight of existing WP code behind it, but it vexes
me.  Half the time I have to highlight a tab character in my
editor-of-the-moment and put it in my clipboard so that I can put the tab
characters in by hitting paste.

That said, I think the document is a very good one that should be referenced
from Hello Dolly.  

The one thing I would change is that I think this topic should specifically
mention the convention for naming functions, variables, and constants.  PEAR
specifies that here: http://pear.php.net/manual/en/standards.naming.php and
it is probably one of the most important areas to cover, since all of that
stuff is case sensitive and is easily overlooked when debugging.

_______________________________________________
Brian Layman
www.TheCodeCave.com
 



More information about the wp-hackers mailing list