January 15, 2013

Symfony is Coming! This is Why You Should Care

By Max Pearl

Whether you belong to an organization which has, or is planning a Drupal site implementation, or a Drupal developer, you should know, and care about Symfony.

Let's do a quick history lesson. Back in the day (and, unfortunately, done far too often even now) when people built websites and web applications using the programming language PHP, which was designed primarily for use in web development, they wrote their own authentication layers, database layers, etc. That made code hard to maintain, and brought in lots of opportunities for errors and security vulnerabilities. In addition, it meant people built this stuff over and over again, and people paid for it. Around about 2005 or so, things started to change in a big way, on two fronts. On one front, the myriad landscape of proprietary and open source small-scale PHP-based CMS projects greatly narrowed down, and people started primarily using open source projects like Drupal, WordPress and Joomla. And on the back-end, for folks who felt they needed more than any of those CMS systems could provide, people started to build websites and web applications using a PHP framework. The four most well-known PHP frameworks (and there are many) are CakePHPSymfonyZend, and CodeIgniter.

So what is a PHP framework? It's a set of tools which allow you to use pre-existing components really easily. Need authentication? Just include a library. Also, these frameworks use something called the "Model-View-Controller" design pattern. This allows the decoupling of the data model from its presentation (among other advantages I won't go into right now - suffice it to say that using MVC is considered a programming best practice.) Building a website or web application with a framework is a lot easier (and takes a lot less time, therefore money) than building one from scratch. In addition, these frameworks, especially the most popular ones, have a lot of developers working on them, and have become incredibly powerful tools.

A side note. If anyone ever suggests building a new website or web application for you without using a CMS or framework (even if it's just HTML - there's always Twitter Bootstrap), run, don't walk, away from them. There is no earthly reason not to use one, and many, many good reasons to use one, and you will save yourself money and heartache. I promise.

So Drupal has had it's own set of back-end libraries and tools for developers to use for a long time, and they get better as they go on. But it is still custom, still it's own thing, can be hard to learn, and cannot really leverage other tools that have great advantages. Drieshimself said:

The complexity of the custom code, that's used, and the non-standard architecture combines to create a barrier to entry for developers new to Drupal (both experienced and novice developers alike.)

So this is where Symfony comes in. It is an extremely well developed backbone, with a thriving community of developers. This means that Drupal development can focus more on the CMS features, and less on the back-end code. It means Drupal is going to get better, faster. It means that building complex sites will be easier. In addition, Symfony is becoming the back-end framework for more and more cool projects (like phpBB, the most popular bulletin board software bar none.) This only means Symfony will get better, which makes Drupal better, too.

As a back-end developer who has already used Symfony, I'm really psyched for this change. I'm really happy for our nonprofit clients, who are going to get solid, robust websites with Drupal 8. And I'm psyched for the Drupal community, that can leverage these great tools. And, finally, I'm psyched that this is yet another open source victory. There is no way that any proprietary CMS product is going to be able to keep up with Drupal, now that Drupal is going to have Symfony underneath it.