Stephen Orr

Technical Musings.

I Still Hate Symfony2

| Comments

I’ve definitely spent a lot of time complaining about Symfony2.

It’s not likely to stop any time soon either. I find it crude, limiting and to be honest, more than a little bit insulting. To my mind, it’s not ready for primetime consumption.

The fact that caching is basically essential to get a site up and running, that’s an immediate red flag to me. Even with caching, running from Amazon EC2 Large instances, we see a delay of around 10 seconds before a page loads.

Who knows, maybe we’re doing something wrong. It’s certainly possible, since the documentation is so poor.

I want to add a HTML5 cache manifest to my project now - can I find out how? Can I hell. There’s no details ANYWHERE on how I’d go about doing so. Surely if Assetic is processing all of my files, it should have the ability to dump a list of them into a cache file?

Also, the fact that I’ve had to override the standard form components in order to add unique IDs to each element, so that our designer can style them correctly? That’s a problem too. If I’m going to use a framework at all, I want it to make certain decisions for me, for the sake of convention and ease of use. Yes, I should be able to override them. No, I shouldn’t have to, unless I really do want to do something special.

Equally, supporting different output formats seems to be missing from the documentation. I want to provide a JSON API to my internal users, but I can’t do that easily without reproducing a load of stuff. It also seems like with dependency injection I end up writing a whole load more code. Again, I don’t see that as a positive.

Symfony2 may well be the best of the “new-breed” PHP 5.3 frameworks that’s currently available, but that doesn’t mean it’s any good. Now, I’m going back to Rails. I’d never consider using this piece of crap on a project unless I had no other choice.

I Hate Symfony2 (Redux)

| Comments

sigh. Another fruitless day spent fighting with Symfony2.

Today’s issues:

  • Making Doctrine NOT blow up memory limits every time it has to process 4000 events, just because it’s decided to hydrate everything.
  • Figuring out exactly where the CSS and images are supposed to go in these bundles, when one bundle extends another.
  • Completely failing to figure out how to turn off the SSL requirement in the development environment, so I can test an iPhone app with a self-signed certificate.

Oh, and just for good measure:

  • Trying to stop jQuery Mobile being a complete pain in the arse to develop custom styling for. This works in parallel with Symfony2’s piss poor form generation code. Hello, have you guys actually heard of HTML? It’s this pretty cool thing that we’ve had for 25 years or so now. I don’t want to write another fucking widget!

Sorry. Slight bit of frustration there. If the documentation was better, it’d help. But Symfony2 in particular is exactly why developers shouldn’t be allowed to design frameworks without consulting designers. Designers don’t want to learn all this complicated voodoo shit to be able to customise a form, they’ve spent years learning HTML and CSS to do that. For that matter, I don’t want to have to learn all this voodoo shit either, for much the same reason. Give me the tools I need to get the job done, and get the hell out of my way!

I can understand the need for modularity and separation of concerns. I can even see the point of Dependency Injection Containers, and all that goes with them. But really, are they necessary in the PHP world? Or is just this move towards “Enterprise” PHP that is pushing us in that direction? Is it a checkbox on an evaluation form for big companies (does this language support Dependency Injection? check). Well, if so, congratulations. You’ve turned PHP into something that vaguely resembles Java. I hope you’re proud of yourselves.

For me, I’m going to keep pushing for the simpler path. I’ve been able to learn the basics of Objective-C and the iOS SDK in less time than it’s taken me to figure out how to customise a Symfony2 form, that should definitely tell you something.

I’m sure there’ll be many more posts along the lines of this one. I can just tell…

I Hate Symfony2

| Comments

I hate Symfony2.

With a passion.

Why? Basically because, to me, it’s a fine example of how the PHP community has lost its way. Whilst other programming communities are moving towards simpler tools, so that they can get shit done faster, the PHP community is moving toward more complicated tools so that enterprise companies can feel confident that their programmers are working hard.

Symfony2 exemplifies this. With a million different configuration settings, dependency injection, bundles, assets, and even its own templating system, there’s so much to learn it’s actually a bit overwhelming. I’m not denying it’s powerful, or can be in the right hands.

No, what I’m saying is that it’s trying too hard to be future-proof and customisable. That’s fine, as long as your documentation is good enough. Unfortunately, my experience so far has been that Symfony2’s documentation is actually pretty piss poor. It took me about 4 hours to figure out why I couldn’t get my forms to be formatted correctly (it turned out to be because the “form theme” wasn’t being loaded from the correct place).

I guess I’ve been spoilt by my contact with Rails, where people are excited enough to create screencasts, extensive blog posts and shedloads of documentation. And where the tools have been (in the most part) written to have the simplest API possible.

Perhaps I’m being too harsh on Symfony2. Maybe we’re not using it right. But in the absence of decent documentation, the opportunities to get something wrong increase exponentially. For now, the opinion I had when I first initially evaluated it stands: if this is the best framework the PHP community can come up with, no wonder people are looking at other languages.