One of my clients demanded I do a recent project in PHP.
Alarm bells all 'round, but hey, I used to do a lot of things in PHP before I got fed up with the inconsistent API and I hear many people still use it. It's clearly a viable technology for ... things. Sure thing mr. Client, I'll do this in PHP for you.
What could possibly go wrong?
Everything, obviously.
Modern PHP world
There's no such thing. The PHP world is stuck in arcane ways of cobbled together solutions, Not Invented Here syndrome, everyone and their grandma inventing their own CMS-like thing and general weirdness.
And yet, I looked far and wide for a framework similar enough to Django that I could quickly pick up and make something useful without sacrificing my soul to the god of bad engineering practices.
Symfony is an Open Source distributed PHP framework. Of course, when you know how to develop in PHP, you don't need a framework. However, it is very nice to have one!
Get it?
Read it again.
It's horrible because PHP developers are people who still need to be convinced that letting somebody else worry about the boring stuff is better. Of course they can make everything themselves! Are you questioning their manhood by suggesting a framework?
Undeterred, I decided to make my _"Accept some data from the browser. Calculate three things. Send an email" _in Symfony. Using Django this would take one afternoon.
Symfony
I appreciate everything Symfony is trying to do, but Django it is not.
The base architecture is confusing - everything, even the framework, is a plugin of the framework ... what? - the documentation isn't very good and there's no community to speak of.
I'm told this is the most popular PHP framework out there.
Coming upon problems and Googling for answers will leave you pawing your way through a dark corridor, with one eye poked out and half your leg missing. The freshest StackOverflow activity about Symfony is at least six months old. There are no forum posts to be found, almost zero blogposts ...
The internet is screaming DON'T USE THIS at you.
And yet, it's the best way to avoid writing your own form validations, request handling, testing frameworks, object relational mapping and a bunch of other things you've come to take for granted.
However, the greatest offense is from the official documentation. I'm not sure if this is because the authors are trying so hard to sell their Cookbook, or just because they suck at writing docs.
For starters, everything is padded out with a bunch of marketing bullshit and irrelevant hand holding. I know why I'm looking at this damn it! Stop trying to convince me I'm really really going to love the feature you are about to explain; explain the fucking feature!
To make it worse, everything lacks depth. Want to see a list of possible methods? Perhaps all the possible parameters and what they do? Nope.
You can click your way through twenty levels of ... stuff ... and you'll get a short summary_ _of all the parameters and methods and such. A tiny piece of me died every time I went digging through the source code just to discover everything that's possible.
Symfony guys, I understand you're trying to be helpful, but developers are smart humans - even PHP developers - we can figure out how to do something with the basic building blocks, but you really need to tell us what the building blocks are.
:/
All in all, PHP is still a horrible place to be. Symfony makes it a dash more palatable, it's far from perfect, far from really really useful, but the best I could find.
My heart goes to all the programmers stuck in this madness, stay strong!
PS: for anyone wondering, I was/am using Symfony 2.1
Continue reading about Symfony and the scary world of PHP
Semantically similar articles hand-picked by GPT-4
- What I learned of PHP by ignoring it for three months
- First impressions of Rails as a Javascripter
- The web moves fast, how do you keep up?
- Unit testing is anti-productive
- Webdevs, you have no idea how much you know
Learned something new?
Read more Software Engineering Lessons from Production
I write articles with real insight into the career and skills of a modern software engineer. "Raw and honest from the heart!" as one reader described them. Fueled by lessons learned over 20 years of building production code for side-projects, small businesses, and hyper growth startups. Both successful and not.
Subscribe below 👇
Software Engineering Lessons from Production
Join Swizec's Newsletter and get insightful emails 💌 on mindsets, tactics, and technical skills for your career. Real lessons from building production software. No bullshit.
"Man, love your simple writing! Yours is the only newsletter I open and only blog that I give a fuck to read & scroll till the end. And wow always take away lessons with me. Inspiring! And very relatable. 👌"
Have a burning question that you think I can answer? Hit me up on twitter and I'll do my best.
Who am I and who do I help? I'm Swizec Teller and I turn coders into engineers with "Raw and honest from the heart!" writing. No bullshit. Real insights into the career and skills of a modern software engineer.
Want to become a true senior engineer? Take ownership, have autonomy, and be a force multiplier on your team. The Senior Engineer Mindset ebook can help 👉 swizec.com/senior-mindset. These are the shifts in mindset that unlocked my career.
Curious about Serverless and the modern backend? Check out Serverless Handbook, for frontend engineers 👉 ServerlessHandbook.dev
Want to Stop copy pasting D3 examples and create data visualizations of your own? Learn how to build scalable dataviz React components your whole team can understand with React for Data Visualization
Want to get my best emails on JavaScript, React, Serverless, Fullstack Web, or Indie Hacking? Check out swizec.com/collections
Did someone amazing share this letter with you? Wonderful! You can sign up for my weekly letters for software engineers on their path to greatness, here: swizec.com/blog
Want to brush up on your modern JavaScript syntax? Check out my interactive cheatsheet: es6cheatsheet.com
By the way, just in case no one has told you it yet today: I love and appreciate you for who you are ❤️