On Twitter yesterday, I read an article that by Joe Watkins, a long time PHP core developer, called bus factor problem. In short, if 2 people left PHP core development for some reason, it would severely setback PHP for years, and that’s a problem. That’s all I’ll say, because Joe already said so well. I did have some thoughts on perhaps why this is, and possible remedies, which is really what this article is about.
All my experience is in developing web applications. So there are entire areas of computer science I don’t know anything about – compilers, language design, memory management, garbage collection, threading, abstract syntax trees, binary trees, just to name a few. That’s the downside of limiting yourself to web applications. Your knowledge becomes limited to the problems you solve. I don’t think I’m alone in this. I imagine there are a lot of developers like me, in this regard. You feel these gaps in your knowledge. While you might be interested in contributing to PHP core, you have some serious doubts about whether you could do it, in a meaningful way.
Significance and Intimidation
One of the barriers to PHP core development is C programming knowledge. There’s something intimidating about the C language. It’s not the syntax. Perhaps, it’s the idea that C code works on a lower, more technical level that you’re used to in PHP programming.
With PHP scripts, you don’t have to think about the operating system you’re running on. It’s all abstracted away. Consider the sheer amount of permutations of operating system and hardware variations. That alone can feel daunting. Those gaps in knowledge I was talking about earlier – they also play a role.
How am I going to possibly learn all this?, you think to yourself. There’s also the concept of using one programming language to create another. This concept alone is kinda mind blowing. Consider all the PHP code you’ve seen throughout your career – the good, the bad, the ugly, and the truly ancient and convoluted. Now imagine being responsible for writing the code that parses, analyzes, and transforms it into something that runs on the hardware that not only you’re using, but all the various computers other people are using, all while maintaining backwards compatibility. Holy shit! That’s a lot to absorb.
I, for one, am interested. but it’s overwhelming to think about all the stuff I’d have to learn. See above. Perhaps there’s something that can be done to mitigate these issues. I have a few ideas on how we might encourage people to contribute to PHP Core. Granted, all of them are outside my sphere of influence, except for one – the willingness to learn.
Who would make a good contributor? As I see it, you need need two things – C programming knowledge, and a love of PHP. To me, that means experienced C developers who love PHP, and experienced PHP Developers willing to learn C code. I’m in the latter group. How do we target these people, to encourage them to contribute? I don’t know how to find C developers, but for experienced PHP developers who are willing to learn C, I have a couple of ideas. What if there was a column in PHP Architect? Something similar to the Security Corner that Eric Mann writes, but introducing people to the different aspects of the C code behind PHP. This would be a great byte-sized introduction to the guts of PHP. As more people get exposed to the content, perhaps it’ll get less mysterious and daunting. Including an internals talk in PHP conferences would also be a good idea, for stimulating interest.
Let’s say someone’s interest is aroused in learning. Where do the go? People should probably look through the source code on GitHub. A book would be a great resource. I found two books on Amazon, both of which seem good, but a bit out of date, judging by the comments. I haven’t read either of them yet. The first book is Sara Golemon. The second is
To learn PHP Core development, I think mentoring will be necessary. It’s such a specialized type of development, I imagine it’d be hard to sidestep the landmines, without someone to guide you. Apparently, this is already underway, but I don’t know how extensively. It’d great to see people write articles on their blogs about their experience of learning core PHP development. In my experience, the best time to write about something, is the moment you discover the solution.
In addition, perhaps some video courses could be created, each focused on a different feature of the code base. This would help new learners understand how development is done, as well as create visibility. It’s easy to point to a course, whether talking about it on a podcast, or link to it in an article. Speaking of podcasts, I enjoy the PHP Internals News podcast by Derick Rethans.
The final thing, which is the least intimidating, but the most directly geek-able, is some discussion of tools and workflow. What are PHP core contributors using for their C development? Are people using CLion by Jetbrains? GCC command line tools? VSCode? What are the tools being used by modern C programmers? do they use static analysis tools? I have no idea.
I realize this is asking a lot of people, particularly of those who are already doing so much. I’m just approaching this from the learner point of view, thinking about the things that would help me learn. I’ve only just started thinking about this, as I was inspired by Jae Watkin’s article. I wanted to share my thoughts, in the hope that it might spur conversation.
Who else is interested in contributing to PHP Core?