If we can polish a turd, we can polish our code.
Your code doesn’t have to be perfect. In fact, it probably won’t be. But it should be clean, documented, organized, and use proper syntax. It should be polished.
Polishing your code today will make you a better developer, and you’ll thank yourself when you come back to it to do something later. Why do I know this? Because there are many times I’ve done the opposite. I’ve kicked my past self for not polishing code, because when I get back into it is when I pay the price instead of get away with a quick and easy fix.
So, some resources to help you get polishing your code.
Let’s start with basic guides for more polished code
- WordPress coding standards in the Core Handbook. Read every section and commit to the syntax.
- WordPress extensions for Sublime Text 2 and Coda 2.
- Organizing plugin files.
- Use _s as a model for organizing themes.
- Always be debugging! I don’t use exclamation points lightly.
Now let’s get serious about our polish
- Understanding Object Oriented Programming vs Functional Programming.
- Internationalize your strings.
- Make code flexibile: Intro to filters, filters and actions for beginners, and building extensible plugins.
- Always be debugging! Yeah, it’s that important.
Grasping and adopting these concepts with a fervor will make you a happier and more formidable developer.
It’s extremely tempting to “hack it” for small projects, and especially so with WordPress when you’re often dealing with a number of hacks already.
But like you, *every single time* I’ve tried to do the bare minimum, I’ve regretted it. Thanks for the reminder!
Regarding adhering to the WordPress coding standards, there is a project to automate checks for syntax formatting problems and other kinds of issues: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
Thanks for sharing this!
Ya that was one ofthe good post regarding Coding, and Thanks