Why Laravel instead of Yii?

Asked

Viewed 4,784 times

8

It’s been a while since I actually developed in PHP. In my last research, about two years ago, I didn’t hear much about the Laravel, as long as the Yii led some rankings (including my) framework to be chosen for new project.

Anyway, my question can be asked like this:

What are the reasons, in the most objective way possible, that lead a developer to choose Laravel instead of Yii?

Alternatively, the answers may be to the question:

What are the reasons, in the most objective way possible, that lead a developer to nay choose Yii as a framework?


Notes:

  1. I’m not looking for opinions like "I liked X more than Y" but relevant technical information.
  2. I’m not asking which framework I should use, I would just like to try to extract from the PHP architects present here the reasons that led them to choose Laravel.
  3. I know it’s hard to compare frameworks or any software, but there must be some more concrete and objective reason for this choice, or not.
  • 2

    This question is on a fine line. I don’t vote to close because I seem to scrape through most of the 6 items in http://blog.stackoverflow.com/2010/09/good-subjective-bad-subjective/

  • 3

    @Bigown It’s on the limit right? I thought it was weird too. This kind of question usually turns into evangelization.

  • @Bacco This is the bad part. In fact there is this question and in the OS it would be closed even passing the criteria of what is "subjective good". You have to consider this. The answer posted so far, no matter how hard you tried not to push it, is evangelism. I almost voted to close for the possibility of evangelism. In this site start I am preferring to see what the community thinks when I think it has 51%+ chance of being something appropriate for the site.

  • 2

    Software architects must be objective in decisions, at least within a context. As a professional, if your boss asks you why you used the X framework instead of the Y framework, you should be able to answer it in terms of productivity, cost or quality, even if the answer is not an eternal and absolute truth. The problem starts when you try to answer a question like this by looking only at personal experience and, worse, without having experienced both technologies.

  • 2

    @Bigown Hernandes' answer ended up getting good with face of evangelization. If there is no more objective answer in a day or two and the answer is no longer closed, I myself vote to close or ask to exclude.

  • 3

    It would help the question not to open the door to evangelism if a text similar to "You are only qualified to answer the question who knows both technologies and has had experience seriously evaluating the use of one or the other with some depth". It would help in items 4 and 5 of the link I passed above.

Show 1 more comment

3 answers

12


IMHO

Laravel’s biggest advantage over Yii lies in the learning curve. Laravel is a much simpler framework to learn, although it contains all the features common to any WEB project. Also, Laravel has a friendlier and clearer documentation than Yii’s. These two factors can already leverage a good portion of community to Laravel, which means having more people to help you, more tutorials, more people contributing to the framework or libraries/plugins.

In a second perspective is the fact that Laravel was developed as a "meta framework". Using Composer, it has some libraries of its own, the Illuminate, and uses many libraries in the community, such as the Symfony libraries, for example. So we can decouple the parts we want from Laravel or even use other libraries of our choice. Also, as there is the use of third party libraries, it is up to the third party to maintain, giving Laravel a faster update/bugfix cycle.

  • This answer clarifies something very important. On the learning curve, I actually "fought" a few days with Yii’s documentation at the beginning. Also, use a dependency management system (libraries) that is not unique to the framework (not invented here) will really help the community not be creating again numerous extensions that will always get a little outdated.

  • I agree with @Frenetic on the learning curve. I used Yii in a few projects, the flexibility it provided in relation to the frameworks available at the time was much higher. However, it was like learning to drive a car with automatic transmission after a lifetime of driving a manual car. You knew what you could do, you knew the potential, but you didn’t know how to implement it. I found myself spending hours trying to figure out how to do very simple things by not having a single example. Of course, Yii’s documentation has improved a lot, but Laravel is the ball.

4

I don’t know Yii very well, just a glance or another in the code, but I will mention here the positive points that are usually decisive in choosing Laravel.

  • Elegant syntax - Laravel’s syntax is beautiful and expressive, following a bit of Ruby’s syntax philosophy, in which the code should get a little closer to the written language.
  • Solid principles of object orientation - Modern features such as package management and dependencies via composer, Ioc among others make the Framework modern, robust and easy to maintain.
  • Community Incredible - You can get help about Laravel on various channels like Forums, Documentation and communities like this. If you join the #Laravel channel on irc now you can get almost instant help on any aspect of the Framework.
  • Abundant Learning Resources - You will find dozens of e-books written recently on Laravel, with the most different learning approaches, you can still count on resources such as Laracasts, which is a portal specializing in teaching about the Laravel world.
  • Constant improvement - The Laravel is updated with absurd frequency, bringing new patches and resources.
  • Learning curve - The learning curve is very small compared to other large frameworks, like Symfony or Zend Framework, just play for an hour in the Laravel documentation and you won’t want to let go.

You can find an overview of why Laravel is being so adopted at that link, which was written in version 3 but is still valid as a starting point.

  • 2

    "beautiful syntax", "modern features", "instant help", "absurd frequency", "you will no longer want to leave"... seems advertising text.

  • Perhaps it is not a fair comparison when there are no two points (one side and the other). I think the Laravel better, simply because I found some things from Yii odd

-2

I sincerely like both frameworks. I prefer to use Laravel in medium projects such as websites and portals. But when it comes to big design, like big systems, here we go from Yii! Okay, Laravel has Eloquent, but you can’t compare it to Yii’s Active Record which is much more complete.

The Laravel is more elegant indeed, but the Yii is much more complete.

  • 5

    The technical parametres of the technologies are missing, elegant in what sense, based on what? Complete in what sense, based on what?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.