Code // Jan 13, 2017

Ruby on Rails vs. Laravel – Which is better?

Ruby on Rails vs. Laravel - Which is better?

 

Things should be made as simple as possible, but not any simpler.

In the spirit of revising the programming basics, I decided to look into this topic today.

Over the years, there have been so many arguments on Laravel and Rails. Which is better? Which is more difficult to learn? and so on.

 

My Research began…

As a young man aspiring to be a super web developer, who also wants to learn a ‘power’ framework (most importantly, a framework that can get work done and fast too), I started my research by asking some seniors…

 – Google: Which framework is better?

Otemuyiwa: Which is more powerful (since both are)?

Mackenzie: Which do you recommend?

Omeiza: What do you look out for in a framework?

Oluwasegun: Are these two the only powerhouse of web frameworks?

Ifeoluwa: Why should I use them?

And many other senior men (and women) out there, I doff my hat dab for you o.

 

After all these questions, I started my own investigation, which involved:

  • working with each framework and noting the differences and similarities;
  • building simple and pretty complex apps (which I’m too lazy to publish).

 

I came to realize that neither of the frameworks is bad.  Better yet, both frameworks are awesome and unique in their own way.

So here’s what I’m going to do:  I will list out the similarities and differences (respectively) that I came across with while working with each framework.

 

Introduction to Laravel and Ruby on Rails

Hold on a sec… before I proceed, I would like to give a brief intro to both frameworks.

If you like to know more get their books!

1. Laravel

Laravel is a web application framework with expressive, elegant syntax. It is a PHP framework created and released in June 2011, by Mr. Taylor Otwell.

Click here to start your own Laravel journey.

 

2. Ruby on Rails

David Heinemeier Hansson, I love to call him DHH, created Rails from his work on the project management tool – Basecamp, at the web application company also called Basecamp. It’s a Ruby framework, the first release in June 2004, gained popularity around 2005. It caught the attention of Jack Dorsey of Twitter.

Click here to enter the world of Rails.

 

Similarities between Laravel and Ruby on Rails

  1. They are both OOP-based frameworks.
  2. They both follow the MVC software design pattern.
  3. They are both open-source.
  4. They both came from scripting language backgrounds (they don’t need a compiler to interpret their code base).
  5. They both offer awesome features in terms of ORM (Object Relational Mapping) and app structure generally.
  6. They both have an unbelievably awesome community support.
  7. They both emphasize on the Don’t Repeat Yourself (DRY) principle.
  8. Deployment: I don’t know about you, but to deploy both frameworks is hectic (at least for the first try).
  9. They both have huge varieties of external components, Ruby – gem, while Laravel – composer.

 

Differences between Laravel and Ruby on Rails

  1. The programming languages differ. Rails is from Ruby while Laravel is from PHP.
  2. Their syntax is different.
  3. Laravel uses semicolon, but Rails doesn’t.
  4. Rails doesn’t use any curly braces, but Laravel does.
  5. The way rails declares its functions is totally different from Laravel.
  6. Rails is not explicit enough; it assumes too much, but Laravel gives room for creativity. It allows developers to take charge (codebase)  – no scaffolding (I know that an experienced developer can bypass that).

 

NB: The aim of this article isn’t to stimulate more arguments but rather to bridge the gap between the two frameworks.

One other thing. Hmmmm… They are both cheap, so go out there and start learning.

I admit I’m no “know it all”, so leave a reply in the comment section below, with some of the obvious similarities/differences I may have missed out.

Thanks in advance!

 

5 thoughts on “Ruby on Rails vs. Laravel – Which is better?”

  1. Hi Nnadozie,

    You really need to learn the two frameworks and the underlying languages before coming up with that comparison. Take a spin around rails + ruby, I’d recommend Rails Tutorial by Michael Hartl then find time to look for a similar easy to use guide on Laravel + PHP.

    For starters, you should understand that Laravel was a really good attempt to come up with a framework similar to Rails MVC implementation. If you have worked on the two, you will see the very close similarities in the file structures, naming conventions and the implementation of MVC strategies. Granted, Laravel modelled PHP Web Development Framework like Ruby on Rails. And it will improve on somethings and will fallback on many other things.|

    However, the choice for Ruby on Rails is actually the Ruby language itself. Less gibberish than PHP. The major problem with learning Ruby is getting the right study materials together. I have just recently introduced a very good polyglot Developer (he codes very well in C# + .Net + family, Java, PHP+Laravel, AngularJS and Swift+Objective C and a few other languages). Really interesting. I guided him to study RoR. Few weeks later he is back and says not sure he is going back to PHP. That was exactly what happened to me in 2009 before starting on Rails.

    If you are really fast with developing with PHP and not open to learning, surely Laravel will keep looking interesting. But the moment you switch fully to try Rails, you will find it hard to turn back.

    All the best on your choices.

    PS. It might take you 3-4 weeks to get more than a beginner’s grasp of Ruby.

    1. Hello Ademola,

      Thanks for your comment and constructive criticism.

      I’m however not saying Laravel + PHP is better than Rails + Ruby.
      From your comment, I can see that you are a Ruby guy – and a very good one at that. That is not to undermine the power/capability of PHP; a Laravel person might come up today and say PHP is way better.

      That’s however not the goal. The aim of this article is for developers to embrace and appreciate the merits of each framework and also to share it.

      Thanks again, Ademola. Your contribution is highly appreciated.

    2. “Less gibberish than PHP” what do you mean? PHP has evolved man. i have used Rails and Laravel. i will still go with Laravel any day because i prefer php syntax to ruby’s.

Leave a Reply

Your email address will not be published. Required fields are marked *