Software Engineering in WordPress, PHP, and Backend Development

Category: Notes (Page 4 of 49)

Notes on programming-related problems that I’ve encountered while working on various projects.

Happy Thanksgiving

Despite the fact that I don’t know how many people read this the day it’s published – or that it matters, really – I’ve almost always shared a note of thanks on Thanksgiving Day on this site for just about as long as I’ve been writing on this blog.

Why would I stop this year?

Continue reading

Installing Valet on macOS with Homebrew

📝 A Note About Notes

Over the years, I’ve written a lot of posts about similar things (if not the same thing). As is the case with software, though, the way we go about doing things can change.

The purpose of posts like this in this category is to start keeping a running list of notes for things I commonly do and how I do them at the time this post is updated.

I don’t know if I’ll update these posts or if I’ll draft new ones. If this one has no “Last Updated” date at the top, then it’s not been updated.


TL:DR: I’ve used a number of different development environments on my local machine over the years and keep coming back to Valet. Here are the notes I use for installing Valet on macOS.

Continue reading

Don’t Over-Architect Your Blog Posts

At some point, I lost the motivation to write about anything that would include too much code because of the amount of time it would take to:

  • put a functioning solution together,
  • architect it in such a way that’d fit with best practices (at least for OOP),
  • explain the various features about OOP that the reader may not know,
  • then explain the problem.

This is too complex.

I’m not saying that articles shouldn’t be written that explain the concepts of object-oriented programming or shouldn’t talk about certain rationale for why something was done.

Continue reading

Writing PHP Command-Line Applications: Command-Line Arguments

TL;DR: $argv is an array of arguments passed to the script with the first index being the name of the script itself. And $argc is the number of arguments passed to the the script (which will always at least be 1).


Arguably, pun intended, one of the key pieces of command-line application is making sure that they are interactive through command-line arguments. In PHP, there are two variables to understand:

  • $argc is the number of arguments passed to script. Note the script’s filename is always passed as an argument to the script, therefore the minimum value of $argc is 1.
  • $argv is an array of arguments passed to script. Note the first argument $argv[0] is always the name that was used to run the script.
Continue reading
« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑