Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Learning Adventure "Become a Web Developer" - Why RoR?

Hey! :)

I'm already a Webdesigner and I would like to become a Web Developer aswell, so I was doing a little research about the question which one of the programming languages is the best to learn first. However ... The most said it is PHP.

Why did you add Ruby on Rails in the Learning Adventure "Become a Web Developer"? Is it better than PHP?

14 Answers

Ruby on Rails is slightly more complex than PHP, but both are good for different things. Ruby on Rails is better for server-side things in my opinion, while PHP is better for the frontend site. You can build a site such as Wikipedia on PHP, where a site like Twitter is powered by Rails.

Edit: Here is an infographic on that subject by Udemy: https://www.udemy.com/blog/wp-content/uploads/2012/01/PROGRAMMING-LANGUAGE-3.png

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

Hey @Charly,

Great question. I definitely recommend that web designers like you wanting to get started with web programming learn PHP first. (My PHP tutorials here at Treehouse require no prior programming experience, just a working knowledge of HTML & CSS.)

We've had some discussions here on the forum about different languages. (I've included some links below.) Most people would say that Ruby is a superior language to PHP, and Ruby or Python are really good languages to learn programming in general. But they are not really web programming languages; it takes a sophisticated framework like Rails to get Ruby to run on the web. After you have a really good handle on server-side programming with PHP, then I would recommend moving to something like Ruby on Rails.

Hey guys!

Thanks for your advice. Wouldnt it be better to add PHP to this Learning Adventure then? I really like the idea to run straight through a well designed course. Now I will have to stop it to get some PHP course in another section (outside of the adventure)

And there might be other beginners, who go through that (without thinking about to learn PHP first) and regret it later on.

Charly,

When I first started at Treehouse (couple weeks ago) I was kind of in the same situation. I had already done some training on RoR but then I also have a couple websites built with wordpress. In my opinion PHP so far has been a lot easier for me to learn than RoR because I can apply it to the sites I currently own and the site I am attempting to build from scratch with PHP right now. I also agree with Randy, utilizing PHP within my HTML/CSS has allowed me to apply what I am learning on a daily basis.

Another point that might help you, With javascript being a language that adds behavior to an HTML/CSS site there are a lot of similarities between PHP and JS.

Also have you seen the php learning adventure? Seems like it's right up your alley. That's the the one that

PHP learning adventure

Forgive me if I am wrong, but I think it covers most of the curriculum inside the "Become a Web Developer" adventure but replaces PHP and I think this one adds JS.

Hope this helps, Kris

Hasn't Twitter moved some pieces of their code to Java away from RoR because it didn't scale well?

Yes Twitter was first built on RoR then they moved away from it.

A lot of tech founders I speak to all tell me to go with RoR as its less code and more fun to write but I guess thats all personal opinion

Ok, thanks again!

I see PHP-Developer is the right adventure for me then (for the first time) :)

But it is still confusing, so my suggestion is to add PHP and maybe other languages (Python for example) to the Web Developer Adventure. Then you've got two main paths: Design and Development. And nobody has to look up for PHP specifically.

By the way ... as far I can see the bigger companies are looking for guys who are able to write more than one programming language anyway. So it wont hurt to have a bigger adventure on this here.

Just tossing my hat in the ring. :wink: As a developer here at Treehouse, where we use Ruby and Rails, I'm a huge proponent of Ruby. I have a fairly extensive background in PHP, and honestly thought that moving from PHP to Ruby was more confusing with that background for reasons not entirely relevant to this conversation (primarily procedural vs. object-oriented programming).

There's this "easy vs. hard" argument, which is kind of six one way, half-a-dozen the other. Sure, probably 90% of web servers in the world run PHP. That makes it pretty simple to get your code running somewhere. Ruby can be more difficult. But it can also be easier. Services like Heroku make it dead simple to git push heroku your website up to a server and have it up and running in seconds.

Also, I want to clarify something that @Randy said:

...it takes a sophisticated framework like Rails to get Ruby to run on the web.

This isn't entirely true. There are really simple frameworks like Sinatra that can get your site running with just a few lines of code. (Geeky aside: There's actually also a framework called Almost-Sinatra that does all the big things Sinatra does, but the entire framework is six lines of Ruby.)

Ultimately, it really depends on what you want to do. If you want to build simple sites with a little dynamic functionality, PHP will get you there quicker and probably easier. If you want to build big, complicated sites that do lots of things, sure you can do so with PHP (look at Facebook), but I venture to say you'll have more fun doing it in Ruby. :tada:

It also depends on where you want to go. If you want to work for Facebook, learn PHP. If you want to work for nearly any other startup, I'd recommend learning Ruby. If you want to build boutique sites for clients, do it in whatever language you enjoy writing the most.

So, answer those two questions and you have your path before you. Regarding starting with PHP, then transitioning to Ruby, I personally don't think it's necessary.

Hopefully this helps more than it confuses. :neckbeard:

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

Hey @Sean, Thanks for chiming in here! You are right to clarify what I said; thanks for keeping me honest. :~) Instead of saying "sophisticated framework," I think it's fair to say you'll need a "sophisticated server configuration and a framework."

The biggest barrier that I see for most people who want to make web stuff and try to start with Ruby is that they have to think so much about the server. With Ruby, you have to be in the command line executing commands to install gems and deploy the code. That is pretty difficult for many people starting out. You can start writing PHP code using the tools you already know and run it on the web host you already know, and then you can ease into thinking about servers. (This forum post sums it up nicely, where one of our members describes learning Ruby as "breaking his head against Ruby.")

But I would definitely encourage people, after learning PHP, to quickly add a second language. Learning that second language of the same type ("server-side languages" in this case) changes how you think about programming, and it's something people who want to be professional software developers need to learn as early as possible. One of my main goals with the PHP tutorials here at Treehouse is to get people coding in an object-oriented, MVC fashion so that it is easy as possible for them to learn to develop on another web framework like Ruby on Rails.

Great thread... I've been struggling with this decision as well. With time being so finite I can't spend all of my time learning multiple languages... at least not right now. So I think I'm going to go with RoR since it seems to be gaining so much steam.

I can definitely say from recent experience that PHP is far easier to get up and running with. With something like XAMPP and it's included software, it's also a lot easier to poke around and see what's going on behind the scenes. With the RoR videos here, it was a lot more "do this just 'cause" it seemed like.

And I'll bet if you did a quick browse of your local job forums, the majority of employers are still looking for someone who knows PHP/LAMP over RoR. But you'd be able to bag a job with either if you were proficient really.

I'm just disappointed that we don't have more JavaScript based videos here :wink:

Yea :D

I'm at the very beginning of web development yet, but what I have seen while I was doing a research on this topic is that many of the web developers are sticked to their programming language - like they could only choose one to get with into the grave.

Development as far I'm understanding as a designer is more than sticking to a language. It is to create things for humans - the result is important. And we need results that are fun for anyone visiting a website or using a programm.

So I am happy that it is better in this forum (as far I see yet) and I'm looking forward to get better in this sence.

And sorry for my not so perfect english, my mother language is german :D :)

Doing something is always better than doing nothing anyways! I will say that the RoR courses here are a great way to understand what the heck github is all about though. And your English is very good :thumbsup:

I have to echo a few things that Sam said.

I was recently laid off from my IT job where I was also doing a lot of web development using PHP. Whilst looking for a new job, I would often type in "Web Developer" as the first search term, and nearly everything required PHP, amongst a myriad of other languages too. I could probably count the jobs that wanted RoR on my little finger. About half of the jobs also wanted experience in Magento - which is written in PHP (Magento might be a good course to run through in the future too?)

In my mind (and I don't mean to sound cruel here), Treehouse try to force RoR because it is the "Treehouse Way" rather than actually focusing on what most websites use and what most businesses want.

That being said, I have tried a few of the RoR videos. To quote Sam, there was a lot of "do this just 'cause'", and there isn't much explanation into what's going on behind the cryptic commands given.

PHP may be take more code to create the same effect in RoR, but PHP seems to be a lot more obvious, especially if you already have an understanding of HTML. Given that probably 95% of employers want explicit knowledge of PHP, I would suggest that this is the way to go :-)

Dave