Swizec Teller - a geek with a hatswizec.com

Senior Mindset Book

Get promoted, earn a bigger salary, work for top companies

Senior Engineer Mindset cover
Learn more

    Symfony and the scary world of PHP

    PHP Rockstars
    PHP Rockstars

    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

    Symfony Live Paris 2011
    Symfony Live Paris 2011

    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.

    Symfony
    Symfony

    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!

    Madness
    Madness

    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

    Published on October 26th, 2012 in Application programming interface, django, Frameworks, Object-relational mapping, Open source, PHP, Symfony, Uncategorized

    Did you enjoy this article?

    Continue reading about Symfony and the scary world of PHP

    Semantically similar articles hand-picked by GPT-4

    Senior Mindset Book

    Get promoted, earn a bigger salary, work for top companies

    Learn more

    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 ❤️

    Created by Swizec with ❤️