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 (Photo credit: Seldaek)

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 (Photo credit: Wikipedia)

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, by Rickydavid

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

Enhanced by Zemanta