Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 202 of 258)

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

Passing Variables in WordPress: WP_Query

Check out the second post on passing variables in WordPress in loops.

One of the most minute aspects of writing code is opting when – or when not – to use variables.

It sounds like a trivial decision, right? And in some respects, it is, but the longer I’ve been writing code (or, perhaps a better way to put it), is that the more code that I’ve written and had to maintain, the more my opinion has changed on how frequently I use variables.

After being in the industry for a couple of years, I tried to follow the this rule of thumb:

“Only if I need to use this value more than once, then I will store it in a variable.”

And I still think that’s a decent rule of thumb, but the more I’ve worked with systems that, say, interface with a database, or that leverage multi-dimensional arrays, or that some type of iteration (be it an each iterator, a foreach iterator, or something similar), the more I’ve found how storing a variable – even if it’s only going to be used once – can make for slightly more readable code.

Continue reading

Coding Standards and Guidelines (“When in Rome, Program Like the Romans”)

Recently, I was talking with a fellow developer about the various strategies there are for writing code.

By that, I mean we’ve got a number of different paradigms such as object-oriented programming, functional programming, and procedural programming. We’ve got design patterns, strategies, ideas like SOLID, domain-driven design, aspect-oriented programming, and so on.

When it comes to these things – and as with most things – developers can be really opinionated (myself included) about which things are the best to use. To some degree, I think that there’s some part of us that wants to believe the thing that we’ve just learned is “the next great thing” as it relates to writing code.

Maybe that’s an amateur’s mistake, though. I mean, that’s how I felt earlier in my career – I remember whenever I learned, say, domain-driven design and all of the stuff that comes with it, I wanted to implement in all of my future projects because I thought it makes the code so much more readable.

But over time, my opinions have changed.

Sure, I still really like certain aspects of all of the aforementioned programming techniques, but I also know that I can’t apply them all in what I’m doing.

Continue reading

Everything is Important, Not Everything is Urgent

During one of my first jobs working in software, I was responsible for working on the functionality that allowed the front-end to talk to the middle-ware asynchronously.

That sounds way fancier than it really is, right?

Trying to write fancy words, like a sir.

Trying to write fancy words, like a sir.

Basically, I was doing a lot of Ajax. Of course, at the time, it was really cool stuff because it was while Ajax was become more mainstream, and the product on which I was working was using Prototype, and had a lot of neat stuff going on.

But whenever you end up using a new technology, and they are supported in a variety of ways in different browsers, then you’re bound to have edge cases that your users catch that are not caught by you or your testing department.

And if you deeply care about the stuff on which you’re working, getting support tickets for the things on which you’ve worked can sometimes be a major downer.

Continue reading

Should WordPress Editor Styles Be Required For Premium Themes?

At this point, there are a number of great content management-related features that are built directly into WordPress that are easy for theme developers to employ.

Some of these features include:

  • Enabling post formats
  • Automatic feed links
  • Setting the default content width
  • Opting to enable (or disable) featured images
  • …and so on.

And many of these features are widely used by a variety of different themes. Obviously not every theme uses all of the above functions but many use some of them.

But there’s one native feature that, for one reason or another, doesn’t seem to have taken off as much as other features:  WordPress editor styles.

This is a bit odd to me, because I think it’s one of the features that can greatly enhance the experience with a theme, and I think it can contribute to create greater differentiation in premium-grade products.

Continue reading

The Challenges of Feedback Loops in Software Development

One of the things that development teams often talk about is the idea of feedback loops.

Though people may define this a little bit differently depending on their specific circumstance, one way of thinking about them is the amount of time it takes the service provider to request information from the client (or vice versa) and the amount of time as well as the amount of information included in the response.

When it comes to software projects, there are normally two ways in which people consider feedback loops to be valuables:

  1. Small feedback loops
  2. Large feedback loops

So novel, right?

But here’s the question: What do you do when the person to whom you’re providing a service, or the person to whom you’re working with values the opposite type of feedback loop than you do?

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑