Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 70 of 258)

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

Abstract Classes, Part 1 – Abstracting Behavior

About a month ago, I wrote about one of the pillars of object-oriented programming (specifically being Abstraction). In the post, I defined abstraction as the following:

Instead, we’re going to be abstracting ideas into their classes. And there’s a key idea here: A class should represent a noun.

And though that’s still true, the idea of abstract classes is something that’s different in object-oriented programming.

It sounds confusing, right? That is:

  • on one level, we have abstraction being defined as the idea that we take an idea and represent it in a class,
  • on another level, we have abstract classes which are used to help define functions that subclasses must implement.

And if that isn’t confusing enough, we mix this in with interfaces which provide a contract implementing classes must follow, and then we mix it with abstract classes which define methods that also must be implemented but can also implement methods of their own.

Confused yet? No worries. The whole point of the next three posts is to do the following:

  1. Define what abstract classes are,
  2. Describe the different in abstract classes and interfaces,
  3. Help decide when you want to use one over the other.

With that said, here’s the whole idea behind abstract classes.

Continue reading

Iterating on WordPress Administration Screen Design

The idea of an “iterative process” is nothing new in software development. It’s present in a number of different methodologies and likely because it works well especially when getting customer feedback.

One of the places that I also find it useful is when building administration interfaces for WordPress plugins.

To be clear, I’m not a designer, so when it comes to front-end work, I always refer to the style guide and the mockups the designer provides to me from the outset of the project. (I only mention this because I think it’s a practice anyone who’s not a designer should follow, but I digress).

But when it comes to working on administration screens or back-end screens for WordPress, I tend to follow a strict rule: Make sure it looks as natural as possible.

How, then, do iterative development and the interface of WordPress administration screens have anything to do with each other?

Continue reading

It’s Easier to Find a Solution (With Someone Else)

One of the most frustrating aspects of programming is working on a solution to a problem and bumping up against something that we should know how to do or be able to figure out how to do, but we’re unable to do so.

There’s probably a proper psychological term for this or an acronym given that I’m talking about programmers. 🤷🏻‍♂️

Case in point:

Let’s say that I’m working on a project and it has to make an Ajax request. I get the response, I display it, and I also cache the response for 24 hours.

If the user requests the information again, I pull it from the cache, and it looks fine. But what about whenever you’re the first person to hit it in the next 24 hours?

That is, you get a cache-miss, and then you get not only a longer-than-normal request, but you also get a response that needs some additional processing before rendering it to the user?

Easier to Find a Solution

Reading this, you’ve likely got a laundry list of things you’d try to do. And I’d venture to say that everything you’re thinking is likely worth trying if not right.

Ultimately, that’s proving my point. And that’s this: When you’re not as close to the problem, it’s easier to find a solution.

Continue reading

Object-Oriented Programming: Understanding Interfaces

At this point, I’d say that the foundations of understanding object-oriented programming have been laid.

Specifically, I’ve covered:

  1. Abstraction
  2. Encapsulation
  3. Inheritance
  4. Polymorphism

And, yeah, there’s some debate as to what constitutes the foundations (that is, some don’t toss polymorphism into the mix though I do). But the above four should provide a solid foundation off of which to continue building your object-oriented programming skills.

There are more, but I don’t think they are as deep, detailed, or tough to understand as some of the aforementioned concepts. Then again, different things come easier to others.

Understanding Interfaces

At any rate, the next two topics that are important to understand are:

  1. Interfaces
  2. Abstraction

I’ll talk about each separate but make sure that you’ve read the Fundamentals series first because the above two topics will allow you to rely on them and take advantage of them.

Vague, I know, but let me explain and then go from there.

Continue reading

Starting 2018

For the first time in I can’t remember when I took ten days offline. Completely.

https://twitter.com/tommcfarlin/status/944345818034778112

To be clear, when I say “I took time offline,” I don’t mean that I took time offline regarding work. I mean that…

  • I deleted applications from my phone and my computer,
  • I signed out of accounts on my browser,
  • I took time off from work and all forms of social media,
  • I spent time focused on the things I wanted to focus on (versus had to focus on),
  • I spent my time with my family and on thinking through how the past year went and what I want to do in the coming year.

At this point, it’s normal to try to segue into a post about resolutions and but I’m not so much about resolutions as I am about goals.

And I’m not about prescribing goals for anyone but me, anyway. Though it’s common in our space to look back and reflect on the year and how things went, I don’t find posts outlining what we plan to do in the coming year.

That’s probably because it’s far easier to reflect than project (after all, we know less about what’s coming in the year at this point than we do at the end of the year, right?), I still like to spend some time trying to lay out a few goals.

Robert Burns wrote the famous quote:

The best-laid plans of mice and men often go awry.

But since we typically do posts about how the year went, why not write about what we want to do so that, 52 weeks or so from this post, we can look back on what was done, what wasn’t, the surprises, and the why behind it all.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑