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

General Discussion

Ruby or PHP?

I want to learn one backend language. If I learn only one, would you recommend learning Ruby/Rails or PHP? I want to learn general backend development, so which language do you think would be the general best for me to learn? Thanks!

2 Answers

Ethan Lowry
PLUS
Ethan Lowry
Courses Plus Student 7,323 Points

They're both perfectly valid, complete back-end languages that can do whatever you wish.

Ruby/Rails is a lot more modern though and, while I'm somewhat biased, much simpler and more pleasant to learn/use. And while there are certainly still a larger number of PHP jobs around. in my experience most developers think of PHP as being rather nasty to work with and look back on their experiences with it like a sort of traumatic war memory.

But as I said, they can both do everything you'd need your server side code to do.

Okay, I might learn Ruby then. I was wondering because I'd seen a lot of different opinions about which is better and wanted to know what people here thought. I'm still learning JavaScript and Sass now, but when I start learning one Ruby/Rails definately sounds good - the only problem seems to be how easy it is to run Ruby/Rails on a web host, even though they almost all support PHP. I guess I could host things on my computer, though - I'm already running a webserver and I leave it on usually.

Ricky Catron
Ricky Catron
13,023 Points

To even the fight a little because Ruby/ Rails vs PHP just is not a fair fight. It is comparing anApple(Raw PHP) to an Apple Pie(Ruby on Rails and all its jazz).

Ruby on Rails is a framework which makes it easy to use Ruby for web development, PHP can be used to build a webpage with no framework required. If used without a framework PHP is a lot uglier and a it is easy to write aweful code.

BUT add a PHP framework like Laravel or CakePHP, or Symfony and the fight evens out a lot. Those frameworks have all the features of Rails and I would say are perfectly equal.

My favorite thing about PHP is that unlike Ruby it is easy to make sites dynamic with no framework and minimal code. I can turn any HTML page into a dynamic site with only a few lines of PHP.

If can be difficult to work with but it will also teach you a lot about solving problems, searching for solutions, and more.

My choice would be PHP.

--Ricky

If I chose to learn PHP, are any PHP frameworks taught on Treehouse? Otherwise, where would the best place to learn one be?

Ricky Catron
Ricky Catron
13,023 Points

Yes there is! Laravel is taught right here on Treehouse. There are lots of raw PHP courses to help you understand how everything works and get you going. Also each framework has its own documentation and tons of tutorials to get you started that are just a google search away!

-Ricky

One other question - how easy is it to set up Laravel on a web host?

Ricky Catron
Ricky Catron
13,023 Points

Laravel is somewhat complex to set up you would probably need a VPS instead of shared hosting which may cost more money, I instead use Openshift which is free for approximently 3 websites and has an Laravel quickstart to get you up and running quickly. I would honestly say it is a little trickier then Rails to set up on a web host.

All of that said raw PHP is easy to set up on almost any website. Most if not all web hosts support PHP. I am sure with a little bit of looking around you could find a solution that works for you.

Goodluck!

--Ricky