Double Quote Ennui

I’ve noticed an interesting development in my coding lately. In PHP, the language I write in for the most part, strings can single quotes (‘) or double quotes (“). Double quotes allow you to include variables in the string and the value of the variable will be substituted in the output. Single quotes will give you the exact characters you put in the string, including outputting the name of variables, not their values. The codebase I work in is the same codebase I learned to program with about 5 years ago and I’m still living with a lot of old choices I made then. For example, I almost never used single quotes for strings, because sometimes I wanted to put in a variable that I wanted to value of.

Today, as a result of becoming a better programmer over the last five years, I am pretty capable of using the appropriate quotes in differing contexts. In fact, I’ve noticed that the better I get, the more troubled I am by even little things like inappropriate quotes for strings. I don’t think that using double quotes for a simple string is too big of a performance hit, but it has become almost a cognitive hit for me. I also get little hits when I see old loops that are inefficient, badly formatted code, and the like. None of which is really affecting the bottom line of the website. But I’m noticing that as I get better at the big stuff, my brain is learning to be picky about even the smallest stuff.