I learned PHP by accident
Being visibly bad at something in front of people who are paid to be good at it.
I would have told you in January that I don’t write PHP. I’d have said it in a way that sounded like a boundary rather than a gap. Front end, that’s my thing, I do the part you can see.
I’ve written PHP nearly every working day since about March. Nobody assigned it to me. There was no conversation and no course. It happened the way a hill happens while you’re walking.
A gradient, not a wall
Here’s the mechanism, and I don’t think it’s specific to me.
At the last place, templates were mostly HTML with some tags in them, and the line between “markup” and “logic” was roughly visible. You could stay on your side of it for a whole project without especially trying.
Here the templates are PHP. Not “contain PHP.” They are PHP. The file that renders a product listing is a .phtml, and inside it there’s a loop, and inside the loop there’s a call to a method on an object I didn’t instantiate, which returns a collection I need to know something about in order to render it.
So on day one I’m changing markup. On day four I need to know why the collection is empty. On day nine I’m reading the class that builds it. And at no point did I cross a line, because there wasn’t one. There was a gradient, and I’d been describing it as a wall because that was the shape of my last job.
I hadn't been respecting a boundary. I'd been describing the edge of what I'd happened to need, and calling it a specialism.
Being bad at it in public
The genuinely hard part wasn’t the language. PHP is not hard. The hard part was doing something badly in a room where two people do it well and get paid for it.
There’s a particular flavor of dread in asking a question when you suspect the answer is going to be short. I sat on questions for days. I wrote things that worked and were embarrassing and hoped nobody would open that file. Once I copied a pattern out of another template without understanding it, and it was the wrong pattern, and it stayed wrong for six weeks.
What actually shifted it was one of the back-end developers reviewing something of mine and leaving a comment that started “this works, and here’s what I’d do instead.” Not “this is wrong.” The distinction sounds small and it was the whole thing: it established that the code was allowed to exist while being improvable, which is the condition under which you can learn in front of people.
Free with purchase
The unexpected part is what the language turned out to be a side effect of.
I understand data now, in a way I didn’t. Not PHP specifically, but the fact that behind every list on a page there’s a query, and the query has a cost, and the reason the category page takes four seconds is not the CSS. I’d have nodded along to that sentence a year ago. I couldn’t have found it.
I’ve also stopped being able to say “that’s a back-end problem” as though it were a routing instruction. Sometimes it is. But I used to say it about anything that happened before the HTML existed, which is most of what determines whether the page is any good.
And I’m a better front-end developer for it, in a boring practical way: I can now tell whether the awkward thing I’m being asked to do in a template is awkward because I’m doing it wrong, or awkward because the data is arriving in a shape nobody chose deliberately. Those need completely different conversations and I used to have the first one every time.
Dear January me
Two things, neither of which is “learn PHP.”
The first is that the label on your job is a description of what you did last year, not a fence around what you’re allowed to touch. I was using mine as both, and the second use was costing me things.
The second is that the fastest learning I’ve done had nothing to do with courses, which I did plenty of and got real value from and would recommend. It came from needing something specific, on a Tuesday, for a real reason, with somebody waiting. Motivation was never the problem and structure was never the problem. Proximity was the problem, and a job fixes proximity in a way nothing else quite does.
I still wouldn’t call myself a PHP developer, and I notice that’s now a modesty thing rather than a factual one, which is its own small tell.
Ask me again next year 🫠