Care About What Matters

It'd been a while since I've had the free time to write something and I really didn't think it'd be a bitch post but it is and here we are. But, as I sit here at midnight browsing Reddit, and, yes, a little drunk, I find myself raging about the idea of the dumb stuff we care about and why we probably shouldn't.

Case in point, an article called "PHP require vs. include vs. require_once vs. include_once Performance Test" written by Arin Sarkissian way back in 2007. Forgiving the obscenely long and verbose title, Arin goes over the process and code he created to test which of 4 statements (require, include, require_once, includes_once) was the most efficient in terms of performance. It's definitely a good read if for no other reason than the insight into how to test and benchmark code but I think there's more to the article than that.

That said, the article left me unsettled for a couple reasons. First, with the amazement and appreciation that someone had taken the initiative to test a theory instead of just drawing conclusions (something that's pretty rare in my experience). Second though, well the second thing bothered me because of the other more applicable and meaningful question I couldn't shake. Why do we care about this nonsense?

For years I've read articles about how best to handle certain circumstances to improve performance. Some are good. Things like how to use the dir() function to iterate over directories or how to properly write SQL are great and definitely worthwhile reads. On the other hand though, there are tons of articles talking about the advantages of using single quotes over double quotes or, as Arin wrote, which function is better suited for file inclusion; scenarios that matter so minimally that the effort in thinking about the issue is far greater than the gains of switching techniques.

As my friend Caroline would say, "Rubbish; all of it." (she's British).

Care about your SQL. Care about your file system interaction, your loops and your math. Care about your logic. And, because it's so important it demands repeating, care about your SQL.

I promise you, there are zero circumstances where whether you used include_once over require_once is going to be the bottleneck. It will never matter one bit if you concatenate with single quotes rather than use double quotes with nested variables. Hand to fucking god; it will not matter nearly enough to spend any time debating which approach is better.

So before you start spending all your time wondering what is the best technique or method for a specific scenario as yourself how much does it matter.