If you’ve been following my posts recently, you might have noticed that I’ve been working more and more with PHP lately. As someone who was curiously allergic to web dev as a teenager, it has been a strangely healing experience for me.
I’d like to say it’s because my experiments with Laravel, the only OSS work of which I can point to is testing the Homestead VM’s compatibility for Shell Bling Ubuntu, convinced me. But no – Laravel is pretty sweet, but so is Django, but Django has the advantage of using an underlying language that
- I’ve been writing for 16 years,
- Has libraries for practically everything under the sun inside and outside of web dev, and
- Comes ready out-of-the-box on Debian 12.
There’s also the fact that, well, I learned Django ‘formally’. My praise for William S. Vincent and his triptych of tutorial books is even more true today than it was 3 years ago when I first dove into them. But PHP has one thing Python has never had, and, sadly, likely never will: A totally braindead deployment cycle.
Seriously. You spin up a VM, install PHP and FastCGI, maybe nginx if you’re feeling
frisky, and you’re off to the races. You edit your .php
files on the server directly
and reload, and the changes appear in real time – this is hot reloading before hot
reloading! And, since the language is interpreted instead of compiled, in a pinch, you
can always apply your plain text Unix tools to the PHP source code itself for some
truly dark magic. You could probably create a CI/CD staging-testing-production setup
with vanilla PHP, a cronjob, and scp
, were you so inclined, you heartless bastard.
Ultra-simple. Ultra-productive. I wish more (well, any) programming languages took the approach PHP does to building websites.
At the opposite end to PHP on several spectrums, we have Golang. And yet, despite being compiled, Go is, or can be, similarly deployed in an almost entirely braindead manner. The command flags
will, to the best of my knowledge, build a fully static binary that you
can copy right onto the platform of your choice, run, and it will just work,
no extra installations needed. You don’t even need Go’s usual C dependencies,
those are baked right into the binary by the CGO_ENABLED
flag.
I have built fewer things with Go than I have with PHP, but it’s much closer to Python in terms of … well, basically everything, and so I’m much more comfortable picking up and using Go for anything which seems like it may be nontrivial (or not a web app!).
But Go is miles ahead of Python when it comes to packaging thanks to this
design decision. It’s a single binary! You can scp
it to /usr/bin
, and
just call it, and it will work! No more aggravating venv
s or poetry
s
or pip install
s to worry about, which might not even exist in 5 years
in a way you can fetch anymore!! Hallelujah!!!