Wait, Why Coding Standards?
There are several reasons that developers should be using coding standards many of which boil down to the following:
- It defines an expectation of how the code should look for any developer that touches the code
- It maintains its readability overtime
- It provides guardrails for new and experienced developers for knowing the proper way to format their code when introducing (or maintaining) existing features
- It ultimately looks like the same developer wrote all of the code
Overall, it eases the maintainability of a project over time. At least, that’s what it’s supposed to do. Speaking from experience, this is absolutely possible when you adhere to it.
That’s half the challenge.
- They deregister the version of jQuery that ships with WordPress
- They call noConflict on jQuery
- They don’t properly import their scripts
- They write their scripts out inline rather than external files
- …and on.
Now, I say this to be constructively critical – not to put anyone down – but it’s a well-known, often discussed problem and it’s not going away any time soon.
What’s The Biggest Problem?
Instead, they’re comfortable including code, modifying things here and there, and mostly comfortable copying and pasting. This, of course, breeds more of the same problem.
Ultimately, I believe that it boils down to this?
One of the beautiful things about open-source software is that everyone’s invited. The problem is that there’s no one check your skills at the door.
So Can We Do Better?
In short, I think so. Though I do believe there’s a bit of a WordPress Gold Rush going on right now, but there are also people who genuinely care about becoming better WordPress Developers.
And sure, we can document coding standards, do peer reviews, and criticize people on Twitter all day long, but until we actually help people understand what they are doing wrong and why it’s a bad practice, then they’ve little incentive to change simply because they don’t know any better.
So in the second post in this series, I’ll do exactly that.