7 Good Reasons to Use Symfony Framework for Your Project

Written by stevenn.hansen | Published 2017/11/29
Tech Story Tags: php | symfony-framework | symfony | framework | programming

TLDRvia the TL;DR App

Image Source: https://www.seattlesymphony.org/about

The light goes out, and the theater sits in silence for several moments. Soon you hear the first sounds of music. It starts timidly. First, a violin makes acquaintance with you, and, further, step by step other instruments get involved in the common melody. The orchestra plays a beautiful symphony…

Development has much in common with the playing of music. Every part of a web application should work correctly and integrally to respond to user’s needs. The same way as every single instrument should flawlessly perform its part to make the whole musical composition sound harmoniously.

If you have not already guessed, we started with such comparison to introduce you the technology with the most melodious name — Symfony.

Today, 82.8% of all the websites in the world are created with PHP programming language.

A web application or website can be built in pure PHP or with one of its frameworks. It depends on the level of complexity of the application, timeframes of development, the experience of coders, and some other factors.

Symfony ranked 3rd in popularity after Laravel and CodeIgniter. Many advantages of Symfony framework are listed on the official website. But if you want an outside point of view, we’ll share our expert vision.

We have already compared Symfony vs Yii development in our previous article. And now we want to focus on the pros and cons of using Symfony framework.

So, do you want to know why use Symfony for your project?

Image source: https://habrahabr.ru/post/281875/

WHAT IS A FRAMEWORK AND WHY DO YOU NEED IT?

Before we jump into the discussion of Symfony, let’s clarify what a framework is.

A framework is a collection of universal, reusable programs that accomplish particular tasks to facilitate the development of software applications.

Metaphorically, it is a skeleton, carcass or basement for a web application or website development. The same way as you buy an empty house and fill it with furniture, developers take a framework and fill it with modules of features.

Using a framework is not a must, but it is a good practice to make the coder’s life simpler. The reasons to use a framework are:

  • Faster development. You can save two or three days of work when reusing generic components that go out-of-box. The saved time can be dedicated to developing of specific features.
  • Easier maintainability. Using a framework imposes a certain structure and common rules to follow. Thus, it won’t be a problem for a new developer or team to join the ongoing project.
  • Fewer issues. The framework code is clear and proven which reduces the number of mistakes.
  • Better security. The framework components are supported with timely upgrades and enhancement of security.

There is probably no good answer which solution suits better for your project. You can read tons of researches and still do not receive a clear vision. Any tool can be equally good or bad depending on people who use it. When you make a choice, let the following idea lead you:

A framework means nothing without a developer who is good in it. If you find an excellent specialist, it won’t really matter which framework to use as far as he/she is proficient in it.

GOOD REASONS FOR CHOOSING SYMFONY

Symfony was released in 2005 and has made a long way to win the reputation of the most mature and reliable PHP framework. It is the number 1 choice for the enterprise web applications. And here is why:

  1. High flexibility

Symfony is one of the most feature-rich PHP frameworks. The two most outstanding technological benefits of Symfony that make it so awesome are Bundles and Components.

The bundle is almost the same as a plugin. Regard it like a package of files (PHP files, stylesheets, JavaScripts, images) for implementing any feature (for ex, a blog, a shopping cart etc). The main benefit of bundles is that they are decoupled. You can reconfigure and reuse them for many applications to reduce the overall development cost.

The components are generic features that reduce the routine tasks and allow developers to focus on specific business features. There are 30 helpful Symfony components that facilitate the development process. You can use components independently and add your own custom modules with no trouble to the architecture. Symfony components can also be used stand-alone in other frameworks (for ex., Laravel) or in plain PHP solutions.

Bundles and components help to eliminate strict dependencies in the architecture. The fewer dependencies you have, the easier it will be to make changes without risk of breaking other parts of the system. Thus, you can adapt the solution to any requirements and user scenarios to create a highly flexible application.

Image Source: http://www.programering.com/a/MTN4EjMwATE.html

2. Company behind the technology

Symfony is one of few frameworks that are commercially supported. SensioLabs, the company-creator, and sponsor, actively contributes to its reputation. They provide official tutorials and certification. In the Company website, you will find a schedule of the upcoming conferences all over the world. This shows the scale and seriousness of their intentions and beliefs.

3. Proven reliability

Symfony has proven its reliability over time while many other frameworks failed. Many notable platforms as phpBB, Drupal, Magento, and eZ Publish use its components. And you definitely know the following companies that trusted Symfony with their websites:

4. Easy testing

Each new line of code should be tested to guarantee stable work of an application. Reusing of bundles, an absence of strict dependencies and possibility to create design patterns contribute to better maintainability and testing in Symfony. Unit testing is very easy because of using PHPUnit independent library. Functional testing is also automated to reduce the developer’s routine.

5. Long-term support

Symfony is a stable and well-tested framework with regular updates. The most recent versions stay long-term supported and compatible with the newer releases: up to 3 years for some of the versions.

6. Large community

One of the influential aspects for a framework survivability is a good community. The official website declares 2000+ contributors (1734 on Github) in their community. This number is several times bigger than that of other PHP frameworks communities.

Why community matters? Not only the core developers work on improvements. Symfony is an open-source. This means that PHP experts and enthusiasts from all over the world take part in making the code better for everybody. In the community, people cooperate with each other. They create new components, try to solve emerged issues, or help others with advice.

7. Good documentation

Incomplete or outdated documentation is a problem of many technologies. Symfony documentation is considered one of the best, compared to the documentation of other PHP frameworks. It is clearly written, well-structured, supplied with eхamples, and updated from version to version. You can find an explanation of every component and the development process as a whole.

REASONS NOT TO CHOOSE SYMFONY

It would be unfair if we mention only pluses and escape minuses. Nothing is perfect!

  1. Performance

The main drawback often complained of is Symfony performance. Performance is important for high load real-time applications (when a lot of users interact with an app at the same moment, like in a social media). But Symfony grows accumulating best things from other technologies. One of the ways to enhance the performance is to migrate your application from PHP 5.6 to PHP7 which can make the app almost twice faster.

Image source: https://www.cloudways.com/blog/php-5-6-vs-php-7-symfony-benchmarks/

2. Longer to launch

It is a common practice of Symfony to use design patterns, i.e. apply once created code for other parts of the system. This facilitates testing and further support but can reduce the speed of the development and delay the launch date.

3. Steep learning curve

Symfony requires much more effort to learn than, for example, Laravel and Yii, which are more intuitively understandable. But it is one of the most stable frameworks that allows making complex solutions with many changes ahead. That is why the specialists in Symfony are highly valuable.

Conclusion

…The music has stopped. The audience stays silent for a moment to burst into applause the next second as the light is on again. People turn around to share their impressions with other spectators…

A framework is aimed to simplify and speed up the development process. Symfony is a powerful and robust PHP framework.

The projects created with this platform are highly extensible because of modular-based architecture. Use of bundles and components makes it a brilliant solution for websites and applications of any size and complexity. Though it is not easy to learn it, one can always find a good documentation, official courses, and support of the community.

Speed and performance are not strong points of Symfony. But experienced coders can overcome the problems that may arise with high-loaded applications.

No matter what framework you choose, don’t forget that it is just a tool. The success depends on whether the development is in good hands or not.

Have more questions as for PHP frameworks? Write to us, at Greenice.net, and we’ll come to help!


Published by HackerNoon on 2017/11/29