PSR-2: The Tough Decision

Posted: 2013-04-01
Category: PHP

PSR-2 has been out for a while now, and even though developers from member projects (such as Joomla, Drupal, phpBB, CakePHP, Symfony and Zend) got together and took part in a entirely fair vote to decide if tabs or spaces should be involved, it soon became apparent that the group had made a mistake.

Due to an overwhelming surge of complaints about the use of spaces for indentation instead of tabs in PSR-2, the PHP-FIG has had no choice but to reverse this decision.

This change of course comes at a cost. It means that every single PSR-2 supporting package will need to be updated if it wishes to maintain PSR-2 compatability. It also means recoding the PHP-CS logic, and CS-Fixer along with that. Changing the website will take a while and educating the community will cause problems, and even though there are no technical benefits to be found in the change, the gains are clear:

Now some of you will no longer have to change the default setting in your IDE's/editors from "Tabs" to "Spaces".

We (the PHP-FIG) feel like the sacrifices listed above, alongside the reduction of the portability of any PSR-2 code are all small prices to pay for this very important pro. After all, having to change that setting - even if only once - really was a pain in the backside.

Now, we completely understand that only about half of you prefer tabs, and the other half were happy with spaces. If the users of Reddit don't all agree that this was the right decision we'll be happy to change it back again in a few months, because everyone having their own personal preference ratified in an optional standard is clearly more important than anything else the PHP-FIG could be working on. I understand.

Thanks for all the wonderful feedback on this topic, and we look forward to hearing constructive feedback during this difficult period of transition.

Comments

Gravatar
Jerel

2013-04-01

Ok that's it. I'm done with this PRS stuff. I'm switching to all javascript cause I don't even have to use semi-colons there

Gravatar
Don Gilbert

2013-04-01

If this were posted any other day, I would be pretty happy, but considering today is April 1st, it's gotta be taken with a grain of salt. I'll need to see the commit before I start dancing. :|

Gravatar
Alexander Makarov

2013-04-01

Too sad it's 1st April :(

Gravatar
Lee Tengum

2013-04-01

Can't we just left align everything and do away with whitespace all together?

That makes coding on an Windows phone so much easier and reduces the huge performance overhead of the parser having to scroll right to parse the code.

Gravatar
Kc

2013-04-01

Definitely april fools. Simply because there wasn't a single expletive uttered in this post :) -kc

Gravatar
Dan Syme

2013-04-01

hah, well done.

Gravatar
Johnathan Warlick

2013-04-01

haha nicely done!

Gravatar
Benjamin Kohl

2013-04-01

Good one.

Gravatar
Max Schwanekamp

2013-04-01

The best April Fools so far this year. All hail Phil Sturgeon, King of Fools. Er, maybe that doesn't sound so attractive. Hrmf.

Gravatar
Sid

2013-04-01

What? What the duck? For ducks sake, leave PSR2 alone. If you wanna mess with it, you'll have to deal with me. Leave PSR2 alone. I mean it.

Gravatar
Christian Bundy

2013-04-02

spaces > tabs orangered > periwinkle

Gravatar
Flowerpoop

2013-04-02

another reason why @mwop left. too much bull shit.

Posting comments after three months has been disabled.