Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Rails hard to understand for a PHP developer?

i know nothing about ruby but a lot about php.

when you code in ror...do you actually understand what is going on under the surface if you are a beginner? and do you HAVE TO understand it or is it good enough just to know enough to build something fast?

Looking for experiences from people who have made the transition.

like image 211
ajsie Avatar asked Nov 11 '09 23:11

ajsie


People also ask

Is Rails hard to learn?

Is it hard to learn Ruby on Rails? Ruby on Rails is a server-side (back-end) web application framework that has been written in Ruby. It's a model-view-controller framework that provides default database, web page, and web service structures. And no, it's not hard to learn at all!

Is PHP easier than Ruby?

PHP vs Ruby speed: The majority projects that are built with PHP are simple and doesn't consume a lot of memory. It is easier to scale a PHP website since small projects don't require over-the-top features and don't take up a lot of memory. Ruby, on the other hand, takes more memory and has some speed limitations.

Is PHP better than Ruby on Rails?

PHP 7.0 has built-in web development capabilities and has been configured to perform better, without gobbling up more memory. But despite this, PHP frameworks still vary in the actual performance they deliver. In contrast, Ruby on Rails is good at speeding through a great many requests each second.

Is PHP language difficult to learn?

PHP is an easy language to grasp, and it's a great start before you dive into more complex web languages like HTML,CSS, SQL, and JavaScript. If you're learning WordPress too, keep an eye on what people are using with it.


8 Answers

IMO having gone from C# to Ruby on Rails back to C#, is that you can get by with simple apps that fully meet the Rails "opinions" without knowing what goes on. However, you'll run into roadblocks the minute you have to do something that's not a trivial CRUD task or need to implement a CRUD task in a different way than the normal render a form, user hits post, basic scaffolded create controller action way. Once you hit that, you'll need to learn more of Ruby itself to figure out exactly what Rails is doing.

like image 118
Wayne Molina Avatar answered Nov 10 '22 01:11

Wayne Molina


Oh yes and as you specifically address rails, there is an up to date, magnificent set of resources at Rails Guides. In addition to a lot of great advice in the many answers here.

like image 42
wentbackward Avatar answered Nov 10 '22 01:11

wentbackward


I would also suggest picking up a copy of The Ruby Programming Language. For me it's the php.net of ruby.

like image 27
Frank Schmitt Avatar answered Nov 10 '22 01:11

Frank Schmitt


Being a PHP developer for a few years now, and coming from a C and C++ background, I can tell you that learning Ruby after PHP is not very hard at all (subjective, but so is the question). Ruby, of course, has it's own idioms and 'best practices' which vary from PHP, but I think you'll find Ruby fun and easy to learn. Many of the 'gotchas' in PHP aren't present in Ruby, so it makes learning the language a bit easier. Plus, if you have any sort of OOP background, you'll be that much better off in understanding Ruby.

As others have pointed out, you can build simple apps with Ruby on Rails quickly enough, but if you need to do any heavy lifting you'll have to begin to understand what lies underneath and how Rails operates. This is no different than with PHP and one of it's various frameworks, such as CakePHP or CodeIgniter.

I also suggest checking out the book Rails for PHP Developers if you are interested in learning RoR.

like image 26
machuga Avatar answered Nov 10 '22 00:11

machuga


You'd be alright if you picked up "Agile Web Development with Rails" - http://www.pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition

like image 27
Eric the Red Avatar answered Nov 10 '22 00:11

Eric the Red


To answer your basic question, as like in all things, you will learn as much as you want to. Do you need to understand what is going on under the hood, no. Do you need to know how ExpressionEngine works in order to create a web site using it?

As for learning Ruby, this is highly advised. Anything beyond trivial websites will require you to know and understand Ruby and its idioms.

I think the biggest problem with going from php to Rails is the method of development. Far too much PHP is created with all, or a lot, of logic sitting in the view. Rails applications are created with all the logic existing in the models. If you understand this, then you are already a long way into understanding Rails.

As for resources, I would recommend getting the book Ruby for Rails: Ruby Techniques for Rails Developers by David Black. It is designed to take you from a Rails developer to being a Ruby developer.

+1 for all the other resources listed above.

like image 25
Chris Johnston Avatar answered Nov 10 '22 00:11

Chris Johnston


Get the book (+1 to Eric). Also check out http://railscasts.com/

like image 22
Jarrett Meyer Avatar answered Nov 09 '22 23:11

Jarrett Meyer


Ruby can be tough, writing Ruby with Rails is easy! The language is natural and reads really nicely. Deploying Rails apps is where (IMO) the challenge lies. You'll have no problem if you know PHP well, especially when you have a book like Rails for PHP Developers

like image 38
typeoneerror Avatar answered Nov 10 '22 00:11

typeoneerror