Ever been sick and go out only to see someone and the first thing you say is “Sorry, I don’t want to shake your hand because I’ve got a bit of a cold”? Well you should feel the same thing with your code before sharing it with the world if you have no validated it with a coding standard. Since my focus is on WordPress and for this post I’m referring more specifically to the WordPress Coding Standards. By the end of this post you’ll have Atom automatically validating your PHP code using PHP CodeSniffer with WordPress Coding Standards in Atom. Why do we care? When you share code it’s expected to be of a certain quality. We want it to be high quality code. However the only way to be certain on that is through an effective practice of validation through coding standards. Before I get to deep into it, what does “high quality” mean? PHP is PHP, right? Not entirely correct. Sure you can write PHP so that it runs and goes through error and warning free to display whatever it is that you want on the screen. Since WordPress is open source there are many people who contribute to the project. Which means everyone has a different style to their code. Some like spaces instead of tabs for indentation.
Share This