Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 211 of 258)

Personal opinions and how-to’s that I’ve written both here and as contributions to other blogs.

Using Mixins in CSS: Developer Abuse and Misuse

When it comes to the various CSS preprocessors that are available today, I think one of the dangers that we – as developers – face is using certain features that were not previously possible in vanilla CSS as a sort of crutch.

By that, I mean that I think that we have a tendency to fall back on things that we’re used to in our server-side environments as opposed to practices that are more preferential on the client side.

For example, I there are things that we used to do – or should be doing – with class names as opposed to mixins, but may not end up falling back to using mixins as opposed to more general classnames.

Confused?

Continue reading

The Dangers of Blogging (Or “Get a Thicker Skin”)

Arguably, one of the most intimidating things about blogging is knowing that you’re constantly opening yourself up to critique.

For the most part, this isn’t something that’s really all that bad especially when you consider that that you’re offering information up to help others, or to ask others for help in a given situation.

More often than not, I’ve found that people are happy to oblige one way or the other through comments, emails, tweets, and so on.

Unfortunately, you can’t have one without the other.

By that, I mean that every positive comment, every reaffirmation, or every bit of advice offering ways to improve what you’re on saying, you’re likely going to be generating negative feedback and/or criticism from someone.

The thing is, positive feedback usually comes in the form of retweets, shares, and so on.

Negative feedback may be harder to detect unless it’s posted directly in a comment because – for whatever reason – others don’t always mention your handle in tweets, pingbacks, and so on.

On one hand, perhaps ignorance is bliss, but I’m of a different mindset: If you have something negative to say about a person or an idea that they’ve shared (after all, it’s not always personal), then why not bring it to their attention?

Continue reading

On Using Helper Files in WordPress

One of the things that I appreciate about certain application development frameworks is their approach to convention over configuration.

By that, I mean that they tend to take the approach of “a place for everything, and everything in its place” rather than setting a ton of variables in a set of different files to tell the core system where everything is located.

In my opinion, WordPress is a little bit of hybrid of this kind of stuff, but I tend to look at it in the direction of modifying configuration files.

After all, we have both `wp-config.php` and we have `functions.php`. Both of these serve their purpose, but `functions.php` can get specifically cluttered as a theme or an application grows.

Continue reading

Software is Malleable (Or “A Case For a Strong 1.0”)

The longer I’ve worked in developer – and the more developers with whom I’ve interacted – the more I recognize that we all share a single trait:

We want to get our project right the first time.

Of course, this looks different depending on the type of project, but the point remains: We want to make sure that we nail not only the larger details, but the smaller details correct for the first release.

  • Have we detailed all the features?
  • Have we tested across every single device?
  • Did we select the right font size?
  • Should this feature automatically work, or should it have an element exposed to control it?
  • …and so on

And even though this is true, I think that deep down we know it’s not really possible to achieve.

In fact, I’ve talked numerous times about what I call a strong 1.0 which is essentially the idea that you focus very hard on an MVP – trim the features, nail down the specifics for the first release, and then iterate.

And when it comes to that compulsive need that we – as developers (and probably designers, as well) – have, this can go along way in helping to make a better product.

Continue reading

Modular Procedural Programming The WordPress Theme Customizer

One of the things that I love about working with WordPress is the entire hook system – you know, the various `add_action` and `add_filter` calls that you can make in order to manipulate content prior to sending it up to the browser.

I think that it provides a really powerful mechanism for working content prior to saving it to. or retrieving it from, the database.

Now, to be clear, I’m not someone who thinks that everything should be object-oriented versus functional versus procedural. Generally speaking, I think that certain paradigms lend themselves to certain strategies more so than others.

Case in point: The fact that WordPress `functions.php` file is nothing more than a collection of functions is fine with me; however, I really like the fact that I can write plugins using object-oriented programming.

Anyway, one of the the things about the hook system is that it can result in writing repetitive code – which I’ll show in a moment – which can in turn make for very long, very tedious, and very redundant functions.

Or, more generally stated, it can result in less than stellar programming practices.

So when these situations arise, I try to look for opportunities that help to keep functions lean, but yet maintaining a purpose, as well as easy to follow. I think it pays off significantly when it comes time to read back through the code, maintain the code, and to document the code.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑