It probably gets a bit tiresome to talk about coding standards, practices, and things like that when you’re trying to focus on simply getting things done.

And though I get it, I also think that having standards and practices – at least within the context of your team – can go a long way regarding being productive, writing maintainable code, and having things in place to help with maintenance over time.

PSRs or WordPress Coding Standards: The PSRs

All of that’s beside the point, though. In the last few years, I’ve found that WordPress – at least those who work on the server-side – usually come in two flavors:

  1. Those who follow the WordPress Coding Standards,
  2. Those who follow the PSRs.

I think there are good reasons for choosing either one. Naturally, I’d say that because I’ve almost always used the WordPress Coding Standards (I have very few exceptions), but I understand the choice to use the alternative as well.

PSRs or WordPress Coding Standards: The WordPress Coding Standards

And it’s something I’m beginning to consider doing, too. But I’m curious, for anyone who’s used both or who has an opinion (strong or otherwise) on which one and why to share.

PSRs or WordPress Coding Standards?

For those who are curious, I think the arguments on either side of these standards usually go something like this:

  1. I use the WordPress Coding Standards because I’m building a solution on top of WordPress. Since it, as a platform, as its set of rules, then I opt to use those rules, so others who come along to look at it or even maintain it can use the set of rules they [should] already know. Further, the WordPress rules are dated in comparison to what’s available now.
  2. I use the PSRs because the WordPress Coding Standards only apply to code that is going into core. WordPress’ rules are years behind what the rest of the PHP community is doing. And using the PSRs will yield greater understanding by a wider variety of people and allow us to leverage newer features of PHP.

I’ve likely oversimplified some of the arguments, but I’m trying to hit the high points more than anything else.

So if you’re a professional WordPress developer – be it someone who makes a living off of WordPress or not – I’m curious on your take and why you’ve opted to choose the particular group of standards.

Share:

Leave a Reply