Makng Tansition from PHP to Rails

Hi there,

I am quite an experienced PHP developer but I am thinking about developing a MVC application but using rails instead not only for another string to my bow but also for a change. The application is quite challenging and mainly deals with delivering YouTube content through the YT API.

I was wondering if this is a wise move in that the learning curve from PHP to Rails may be too intense, could you please advise me if this is so and also tell me a liittle bit about the dis/advantages of using Rails as opposed to existing PHP based frameworks like ZEND and CodeIgniter?

tHX

I guess it depends on what kind of deadline you have. If this is a project just for yourself, then by all means, take the time to learn Ruby and RoR. But if this is a project for a client with a hard deadline, then I think you should use what you’re familiar with.

What Jeff said, never accept work on a timeline if you’re unfamiliar with the tooling.
Yes, you should learn Rails, because you’ll love it.

I was wondering if this is a wise move in that the learning curve from PHP to Rails may be too intense, could you please advise me if this is so and also tell me a little bit about the dis/advantages of using Rails as opposed to existing PHP based frameworks like ZEND and CodeIgniter?

I’m unfamiliar with php frameworks.

A few advantages are:

  • It’s easier. The conventions make a lot of sense so things just work. Encourages simple elegant code.
  • very active community, gems provide packages for almost everything you want to do on the web
  • PHP’s OO model was an afterthought and it shows, Ruby is a beautiful language.
  • programmer happiness

And, don’t forget, Geeky Coolness. Ruby & Rails is one of the “hot topics” and still growing.

I recommend this book if you’re a php programmer interested in trying rails: http://www.amazon.com/Rails-PHP-Developers-Pragmatic-Programmers/dp/1934356042

It has a lot of language specifically geared towards the php developer, and it explains a lot of concepts using parallels in the php world. It also comes with all the requisite “ruby fanboy” jargon. You know. The usual stuff like “looking at ruby code is like beholding a breathtaking sunset” or “writing in ruby is like composing a sonnet.” Along with a whole bunch of other dorky metaphors they love to throw around. You’ll be a drooling fanboy in no time!

Wow, thanks I will definitely check that out :wink:

I’m an experienced php dev of 6 years now. I’ve spent a lot of time learning different frameworks in PHP and learning how to write neat OOP code using design patterns and unit testing.

All well and good, but the amount of horrible code I still inherit drives me mad! I’ve decided to take a look at Ruby now myself.

One resource I’ve just found is called Ruby Koans - the idea is that you start with a bunch of failing unit tests and have to fix each issue while learning the Ruby language. I thought this was a brilliant idea, so I’m looking at this now. Might have a skim read of a book first and then go through these.

I’m hoping Ruby is all it’s hyped up to be. I am so tired of inheriting awful php code.

So you want to inherit awful ruby code instead? ;{>}

That’s only half flippant. As the number of ruby coders grows, the total amount of awful ruby is growing as well; it has to, it’s a law of the universe. I make this point because inheriting bad code is what you’re going to be doing, no matter what language platform you’re on. It’s part of the job.

In my opinion it seems like a significant amount of PHP development involves using others god awful tools. It is more about being able to install, configure and customize existing solutions than ground up development. Honestly, that is one of reasons I’m beginning to learn ruby and rails. I’m becoming sick and tired of the PHP market being saturated by things such as Wordpress, Drupal, Magento, etc. I’ve always enjoyed building things myself and those types of tools while they have their place I’m getting quite sick of dealing with them. Not to mention every PHP MVC framework out there is a pile of crap when compared to the grand daddy of them all – rails. Besides it is always good to expand your horizon.

I’ve been using PHP now for about 5 years and to be quit frank am getting a little sick of it. From the *types of projects to inherit lack of quality associated with many things I see developed in it. Mostly though I don’t really think there is a future for PHP outside of the types of projects which were previously listed. I enjoy building things and programming – not configuring stupid content management systems and dealing with poorly built products. Someone else might have a different perspective but it seems like the asp, rails and python market provides much more opportunity to create custom software. That is what the technologies are geared toward. So if you are merely looking to push out simple, budget sites than PHP has more opportunity for that with all the open source cms’s available. There just doesn’t seem to be much custom development going on with PHP considering all the open source things available.

The most painful part of ruby and rials though so far is really setting it all up. I’m on mac os x 10.6 and it has been a painful process to install the most recent version of ruby and rails. Nothing I couldn’t figure out but I ran into several issues which required looking up over the internet to problem solve. However, once the environment was set-up everything seemed to flow smoothly. If you familiar with C, Java, PHP, Python, etc learning the basics of ruby doesn’t seem to be that difficult. If familiar with any PHP based MVC framework than using rails is very similar – only more elegant and intuitive. At least that is my impression after having used CakePHP, CodeIgnitor and Symfony 2.

There’s three other big reasons why Rails apps are less awful.

The Ruby community has the biggest focus on testing of any language I know of.
The Ruby language itself was designed to make programmers happy.
Rails was designed to make programmers happy.

All of the Ruby developers I’ve worked with they are constantly seeking to write more elegant code.

The most painful part of ruby and rials though so far is really setting it all up. I’m on mac os x 10.6 and it has been a painful process to install the most recent version of ruby and rails. Nothing I couldn’t figure out but I ran into several issues which required looking up over the internet to problem solve.

There will be a simple installer in the future.
http://www.kickstarter.com/projects/1397300529/railsapp

I’ve installed the stack about six times now and found I learned quite a bit about the environment in the process.