I was surprised to see that the WordPress Coding Standards were more neurotic about having well-tabbed code than I am.

Indentation
Your indentation should always reflect logical structure. Use real tabs and not spaces, as this allows the most flexibility across clients.

Exception: if you have a block of code that would be more readable if things aligned, you can do initial indentation with tabs and then make up the difference with spaces:

[tab]$foo   = 'somevalue';
[tab]$foo2 = 'somevalue2';
[tab]$foo34 = 'somevalue3';
[tab]$foo5 = 'somevalue4';


Though I hate the idea of lining up equals symbols, I would tend to agree with the "No Shorthand PHP" proclamation.

I've worked for corporations without docs this specific. Imo, having them is a good thing.

Labels: , ,