Selecting right PHP framework for your next project

There is no thing best in the world. If something is best, it means, others simply wont exist and if exist, won't survive.

Same is true for PHP frameworks. Presence of multiple frameworks is proof that no framework is best. So how will we select right framework for our next project?

I am Kapil Sharma, Technical Architect at Eastern Enterprise, with 10.5 years of professional experience in web application development, using different programming languages, CMS & frameworks. This article mainly shows how do I select framework for my next project. Personally I have worked with Zend Framework 1 (not 2), Symfony 1 & 2, Code Ignitor (not working any more), and Laravel 4 & 5. So I might not be the right person to compare all frameworks but it doesn't stops me selecting right framework for next project, does it?

Please note, this article list down my points for considering framework for next project. There could be many who might not agree with me, and I respect their views.

To keep article short, I am assuming we already selected PHP as programming language and ruled out CMS. So only PHP frameworks are considered in this article.

Type of frameworks

I generally keep frameworks in three category:

  • Full fledged frameworks
  • Mid level frameworks
  • Micro frameworks

Full fledged frameworks

These are frameworks which have support for nearly all common web development tasks, you might need in your project. Obviously they are huge and as a result, need time to learn. However once learned, you will not need to look any other framework.

I personally keep only two frameworks in this category; Zend Framework and Symfony.

Major disadvantage of full fledged frameworks include steep learning curve and hosting requirements. You can't (shouldn't) host them on shared hosting or better you will need server farms to host them. Thus they are best suited for enterprise applications.

Major advantage is, good community and professional  support from Sensui Labs (for Symfony) and Zend (for ZF) and professional support, if needed, is crucial for enterprises. Another major advantage is, there are generally more then one way of doing a thing, making it easier to adopt framework in your personal coding style and preferences but on the flip side, it also cause confusions for new programmers.

If you are learning your first framework and have time critical application, I personally recommend not to try them. Better prefer any mid level framework or micro framework to start and once you have some experience with frameworks, try ZF or Symfony.

Mid level frameworks

Don't get confused by my naming. You can create enterprise applications with mid level frameworks. I generally keep frameworks like Laravel, Phalcon, Yii, Cake PHP, Aura etc in this category.

These frameworks are comparatively easier to learn, but at the same time, good to make a web application of any size; Small mobile back-end to enterprise applications. So for  most projects, these are my best bet.

Micro frameworks

They have very small footprint. Needless to say, very easy to learn but to keep their size small and fast execution time, they skip many libraries, commonly used in modern web applications.

Although most micro frameworks support composer, making it easy to install any extra library you need. Still I personally prefer in-build support than manually figuring out best library for a common task.

They could be right choice for small applications like exposing web services for mobile application. Still I personally prefer Laravel (earlier code ignitor) for that, as same knowledge can be used for small and big projects.

Still if we are sure that our application will not be extended (which rarely happens) and execution speed is major concern, specially with shared hosting, micro frameworks could be better choice.

Current knowledge

We all live in a professional world and business always need results in least possible time (minimal investment). In such practical cases, your best bet is a framework, your team is already familiar with.

If team is not familiar with any framework, a framework with least learning curve is best. This obviously make micro framework as best framework but hold down. Your next project could be a big one and you might not want to train your team again with new framework. Remember master of one trade is always better then jack of all trades (Hmm can be argued). So best is, first make your team master in one framework before trying another.

However there could be conditions when you might want to try new things. Taking my example, when I joined Eastern Enterprise, all projects were on ZF1. Developers were very good on ZF (& drupal for mobile back-end). However we were also getting small projects where ZF was not a good fit. Again training new developers in ZF was time taking process too. So that was the good time to look at other options and I selected Laravel 4 at that time. First couple of projects took little extra time but now we have a team of Laravel masters. Again we preferred Symfony 2 over ZF2. One year later, we have a very good team (individual developers) who can work on project of any size.

So the trick is to stick to your strengths but keep a constant eye on changing trends and prepare for future. Assigning one resource on an internal project, for a month, is never difficult.

Conclusions

I recommend to go through different frameworks before deciding best framework for your needs and style. Making small blog application must not take more than couple of days.

Still based on lot of such questions on different forums, if you decided to go with others choice, my recommendations are:

If you are making a big product, with long deadline but lot of features after first release, you need full fledged framework. I recommend Symfony 2 here because of better documentation and  helpful community than ZF2.

If you have service based company, and have projects of different size, mid level frameworks are best for you. I recommend Laravel based on my experience. With LTS version available, it is a safe bet now. Yii was me preference before laravel 5.1 (LTS). This will help you to make both small and big projects. I preferred Laravel over others because of its helpful community and best in class documentation.

If you mainly develop mobile apps and need PHP just for API and small projects, micro framework is good choice. Although I never worked with micro frameworks, Slim Framework will be my preference, if needed. Reason, it is well proved. Lumen seems promising but its a new kid and not proved in production environment. I will never put my money on untested application.

DEEPAK YADAV

Full Stack Engineer

9 年

I worked on all frameworks mentioned above.But the two frameworks which are rising are symfony and laravel.They brought new things like composer which is common now a days.Also a developer should not go directly for Symfony framework which requires a learning and understanding of different fromats its has like yml,schema,doctrine,bundles which is not seen in other micro frameworks.So if you want to choose either go for laravel or zend.The new developer should go for CI and if not satisfied with that then go for zend.Still if you ask me what is best framework for me i will go with Laravel Framework.This is my personal view for choosing frameworks.

回复

要查看或添加评论,请登录

Kapil Sharma的更多文章

  • Linux Power user; enhanced your productivity

    Linux Power user; enhanced your productivity

    Introduction You must have heard about power user or some users/coders doing things very quickly and efficiently…

    2 条评论
  • Setup development environment on new Mac

    Setup development environment on new Mac

    I recently resigned from Eastern Enterprise (Ansh Systems) and submitted my official Mac in the company. I'll be…

  • PHPReboot's WhatsApp weekly newsletter

    PHPReboot's WhatsApp weekly newsletter

    PHP Reboot have a WhatsApp group and we recently started weekly WhatsApp newsletter, where we share latest news, blogs,…

  • Quotes to remember by programmers.

    Quotes to remember by programmers.

    Few quotes that might help you understand what you are doing wrong. Just writing as I'd like to remember them forever.

  • Things I practically learned in 2017

    Things I practically learned in 2017

    One more calendar year is about to finish. It had some mixed success for me and without doubts, great practical…

    5 条评论
  • Comparing Angular JS, React JS and Vue JS

    Comparing Angular JS, React JS and Vue JS

    The article's title is comparing #AngularJS, #ReactJS and #VueJS but I personally hate comparing any tools. I…

    6 条评论
  • Experiment with open meetup

    Experiment with open meetup

    Meetups are a powerful way to grow communities. I'm organising regular PHP meetups in Pune since 2013 by name of PHP…

    2 条评论
  • PHPReboot: Current status and future

    PHPReboot: Current status and future

    I shared following message was posted to PHPReboot meet up newsletter. A must read for PHP developers in Pune.

  • Setting Cent OS minimal for Headless selenium testing

    Setting Cent OS minimal for Headless selenium testing

    This article is first in the 3 part series of . Series include three posts: Setting Cent OS minimal for headless…

    7 条评论
  • Career 1.0: Selecting first programming language

    Career 1.0: Selecting first programming language

    In last 2 months, at least 4-5 computer science students asked me which programming language should they select/learn…

    3 条评论

社区洞察

其他会员也浏览了