Code Comments Say What?

I came across another sentence in Professional WordPress Plugin Development that made me stop and think for a minute:

The major benefit to code commenting is to explain what your code actually does, in plain English.

The triggering word being what.

I always believed that code comments should say why. What should be easy to discern from good code, without the need for additional commentary.

I’m using this rule of thumb for code comments:

Code says what, comments say why.

Name Collisions in PHP

I came across this passage in Professional WordPress Plugin Development:

[…] it’s essential that you prefix everything with a unique prefix. […] one of the most common errors in plugins is using all too common names for function and variables. […] the website will break because you can’t have two functions with the same name in PHP.

So, if I install two plugins from different developers, I cross my fingers and hope that they haven’t used any of the same variable or function names, else my site will suffer the consequences. Plugins are compatible by chance.

Return to WordPress

I’ve been jumping back and forth between different content management systems and static site generators, searching for “the perfect blogging platform.” Now full circle, I’m back to WordPress—This time for the long haul. Despite my PHP-phobia, I cannot find a simpler alternative.

Now that I don’t have an excuse to procrastinate by tinkering on the code behind the scenes of my blog, there’s a chance that I’ll make some headway on my writing and other, more valuable projects. Because time is scarce.