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

Forsake PHP and go with Python, RoR maybe?

So...I went through all the HTML and CSS3 videos in the "Become a PHP Developer" adventure. I skipped over Javascript because I just find the old format videos incoherent and a bit exhausting. The newer ones, including the PHP ones which I'm now watching are worlds apart!

I'm really enjoying learning PHP, it's the first programming language that I enjoy learning. I tried JS and RoR here on Treehouse and, again, found the videos and concepts very hard to grasp, for some reason - it's like they went from explaining and reiterating basic stuff to some high level definitions that I couldn't understand.

But my question which I need an answer to is: should I continue my adventure with PHP or go with either Ruby or Python?

The reason I'm asking is everyone on the internet are saying that PHP is on the (slow, yet steady) decline (although Wordpress uses it, which I am very very familiar with), and Python is harder to learn and also smarter - therefore if you start with Python it's going to be easier to learn PHP later on while going the opposite route will make you shaky with other, more sophisticated languages.

Every respected Stack Overflow and Quora programmer is basically saying the same stuff: if you're start anew, forget about PHP and learn Ruby or Python.

My considerations:

  • I'm absolutely new to programming
  • I have good background with Wordpress and blogging, which might make PHP more accessible
  • I'm looking into innovative ideas but nothing super fancy
  • the video library on TeamTree House

I'm mostly interested in web and mobile website and application development - not games and such but content driven networks like svpply.com thefancy.com etc..

For the more experienced programmers here: if you were to start today, what would you learn as your first programming language: PHP, Python, or Ruby?

Cheers,

23 Answers

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

Hey @S.K.,

Glad to hear you are enjoying my PHP tutorials!

This question (PHP or Ruby) is a great one. It has come up on this forum before. Jim said it best in another thread: PHP is the best choice "if you are just getting started and you are into making web-stuff" (read comment). Based on your background , I would definitely recommend continuing with PHP. Here's part of a comment where I answered a similar question for someone in a similar position:

PHP is easy to understand and deploy once you know HTML. It is native for the web: it was created to make dynamic web pages. If you want to make an HTML file dynamic, you just change its extension to .php and add a snippet of code. Easy. (If you want to do the same thing with Ruby, you need to open up the command line and install a framework and write a route. You'll need some special host that requires you to SSH from the command line into a server to figure out how to get Ruby and all the necessary gems running -- or to use a Git command. Not as easy.) source

Ruby was not originally intended to make web pages at all. You can't really just name a file index.rb and point your browser at it. In fact, to get Ruby to make web pages, you need a sophisticated framework in place like Ruby on Rails. There's also a lot of black magic that Ruby on Rails does for you: it's a great framework and does a lot of heavy-lifting to make your job easier, but it can be really frustrating and painful until you have a good handle on how server-side code works.

My goal for the PHP courses is to do so much more than just teach you PHP. It's to give you that good handle on how server-side code works that will prepare you to work with any web framework ... whether that's in PHP (something like CodeIgniter) or Ruby on Rails. By the time my first three courses are done (I have finished the first of the three), they will provide a solid foundation in variables, conditionals, arrays, loops, functions, objects, form processing, good code structure and design patterns, databases, and object-oriented programming — all the things that I would recommend you know before you start learning Ruby on Rails.

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

Hey @S.K., You said that people recommend programming with Python or Ruby on Rails first. Actually, that's not true. People recommend starting with Python or Ruby first, not with Ruby on Rails. Big difference.

Python and Ruby are both great languages, but you won't be coding web pages if you start with them. You'll be at a command line, writing little programs that run on a desktop computer. This is a really good way to learn programming, but given what you've said about yourself I think it would be a much better idea to keep building web things. PHP will let you learn programming in the context of the web. Once you have a good handle on how server-side programming works, it will be so much easier to make the transition to some of these other things (Ruby on Rails, JavaScript, etc.)

Plus, I promise I won't teach you any bad habits! :~D

Dee Barizo
Dee Barizo
8,402 Points

Hey S.K.,

I come from a similar background as you. I'm very new to programming but I've blogged for a couple years on WordPress.

Most of my programming learning has been done on PHP. I've gone through a good chunk of a SitePoint book and I've gone through Randy's PHP course here.

I've also done a PHP tutorial on sign up authentication and email confirmation and played around with the front-end Bootstrap framework.

I've even started to look into PHP frameworks.

But I think I can already tell after going through the first couple Rails videos on this site, that Rails is the way to go for me because it can save a lot of time.

That said, I'm absolutely glad I did PHP stuff first because the learning curve was not too steep and it taught me basic programming principles that I'm applying to the Rails stuff, principles like variables and loops.

So, my suggestion is continue on with PHP. If you move on to a different language/framework, your PHP knowledge will definitely not go to waste. It gives you a strong coding foundation to understand other languages/frameworks.

Andrew Chalkley
STAFF
Andrew Chalkley
Treehouse Guest Teacher

Hey S.K.,

You should do whatever works for you. Don't listen to people who put things down. Ultimately PHP, Ruby or whatever are tools to solve a problem. People use all these tools to do amazing things. If you're enjoying PHP, go forth and build something great. And if you feel an itch, try something else :) No rush.

Regards Andrew

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

(I took so long writing that last reply that there has been more conversation. :~)

I would definitely recommend not breaking your head on Ruby! Based on how you describe your background, I think my PHP tutorials will be a good way for you to get acclimated to server-side programming ... and get prepared to learn Ruby on Rails.

You probably won't want to stop with PHP, but I think it's the best next step for people who know HTML/CSS and want to work on the web.

Andrew Chalkley
STAFF
Andrew Chalkley
Treehouse Guest Teacher

PHP was a good starting point for me before learning Ruby, Java and JavaScript.

I don't think the "bad habits" argument holds water. I think once you crack PHP and use it it'll unlock more possibilites for you.

I could not agree more, Actually PHP is really cool because it really helps you think about problem solving in different ways. Ala Procedural vs OOP. Personally I love procedural (just roll up you sleeves get your hands in the dirt and start making stuff!) But OOP is cool too and now PHP has Laravel which is supposed to be a lot like Rails. Honestly, I think the best advice, what I should have done...just get in there learn one and start coding! :)

James Barnett
James Barnett
39,199 Points

@Randy - I think of the dozen discussions on the topic of which language should I learn that I've seen on here, I think this one is by far the best.

James Barnett
James Barnett
39,199 Points

Randy -

I used (new awesome) search feature, to look through the forum and I gathered up most of the PHP or Ruby on Rails threads under the tag php or ruby on rails

Long story short, I still think this is the best thread on the topic in the forum. You can peruse through the 5 threads that are under the tag and see if you agree.

J.T. Gralka
J.T. Gralka
20,126 Points

Hey S.K.,

So here's the thing... I'm very biased when it comes to this; I'm a PHP kid at heart, through and through. But, PHP is not the end-all of server-side languages. I understand how difficult it can be to grasp even the most fundamental concepts of a new language, and so there are a lot of good reasons for dabbling in a few different languages.

My advice would be to get your feet wet with PHP, Python, and Ruby. If you ever run into any issues, or if you find that some of the Treehouse tutorials are too hard for you, you can always hit up the forums. The most important thing is to not overwhelm yourself when you get started with a new language. Baby steps.

If you're not a big fan of PHP right now, give Ruby a shot! Ruby and Python are super similar, except syntactically (they are two different languages, of course). With that said, they are really good languages to become familiar with, and they're very powerful languages too!

So, I don't know if I answered your question at all. It seems like you're a bit frustrated with PHP; and, if you are, please don't hesitate to make forum posts asking questions. There are a lot of Treehouse members and teachers who are more than willing to help you out! If you feel like there's something that doesn't click, don't be afraid to hit us up!

With that said, I wish you the very best in your server-side programming future!

Cheers,

J.T.

JT, Thanks for your reply. Maybe my first post was a bit incoherent: I'm enjoying learning PHP and I'm enjoying the PHP videos as well!

And that's what's concerning me: should I breaking my head with Ruby (and the old-format, tough to understand Ruby videos on Treehouse) just because it is better regarded? or maybe go with Python? (Which TeamtreeHouse doesn't offer yet).

J.T. Gralka
J.T. Gralka
20,126 Points

S K,

When I suggested that you take on RoR, I didn't mean to overwhelm you! I think your best bet would be to keep going with PHP to become more comfortable with how server-side scripting works. My advice is not to give up on PHP, but don't be afraid to find your comfort zone either!

Again, don't hesitate post questions if you have any.

Best,

J.T.

Edit:

I see that Randy has already beat me to the punch here. :-) Suffice to say that I +1 what he said completely. He brings up a lot of good points..

Thank you guys for the well-thought responses to my dilemma.

I know in a nutshell that one should go with "whatever works for him", and currently PHP is going pretty well as I'm finding it easier to understand the syntax and most importantly, how the different commands can be applied and used in websites and applications, something I didn't quite understand with Ruby or Javascript.

But,

But I think I can already tell after going through the first couple Rails videos on this site, that Rails is the way to go for me because it can save a lot of time.

Since I know for a fact that it will take me long months, maybe even years to learn any programming language to an extent that makes me a programmer, I want to start the right way, and with the right language. I have heard arguments that one should learn RoR or Python first because they teach you how to code better, while PHP learning will make you develop "bad habits". Also, there seems to be a consensus that RoR and Python are smarter, more efficient and powerful languages than PHP, so I'm wondering whether I should start with them, although I imagine that will make my learning curve much steeper, possible leading me to all sorts of dead-end and burnout.

The work done by Randy Hoyt on the PHP videos is marvelous, after having watched videos from different era and hosts of TeamTreeHouse. I mean, all of you guys got better but I'm enjoying the brevity, applicability and effectiveness of Hoyt's videos. I'm very worried that I will complete all of the PHP videos available before his next series goes up.

What I think I will do is continue on with PHP, because my first priority is to have a motivation to keep learning and not giving up because "coding is too damn hard", and then we'll worry about effectiveness and conquering the web :)

J.T. Gralka
J.T. Gralka
20,126 Points

S K,

That's the spirit! I think if you keep with it, you'll find that it's not as hard to program as you might have previously thought. What I meant in my previous posts is that its easy to get bum-puzzled with particular constructs or individual languages. The best thing you can do is play around with the languages you feel most comfortable with -- Try different things; if something's not working out for you at first, dig a little deeper and try to sort out why you're having trouble.

What's great about Randy's videos (and all of the Treehouse videos, for that matter) is that they start simple and build upon themselves to let students expand upon their understanding. Like Randy and Andrew already said, don't be too concerned about what other people say about which language trumps all the rest; if you like PHP, then start building some simple PHP applications to test your skills. If you need any inspiration, give a shout out! :-)

Again, best of luck!

J.T.

Guys, thanks for taking the time to advise. Randy strikes again and gave me the reason why I should start with PHP.

Now you just have to hurry up and get your more advanced series up, aight? :)

@James - I whole-heartedly agreed. This is one if those "please sticky" discussions (if we had that option).

By the way, this is what I'm talking about regarding exprienced developers and PHP: How PHP ruined my life as a software developer

James Barnett
James Barnett
39,199 Points

Randy - Since Ruby on Rails vs PHP is such a popular discussion, maybe this could become a featured post. Thoughts?

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

Hey James, I think that's a good idea. Do you still think this thread is the best one on the subject in this forum?

Joel Rivera
Joel Rivera
29,401 Points

This was a great read. I am new to php. I designed my personal sites with regular html / css. Now I am looking to advance my skills. Looking to learn PHP and Javascript. How much time should I be investing to learn PHP and javascript? how long does it normally take to go from complete noob to being able to develop sites? I am now taking the courses on treehouse and reading some items offline. Just wanted to know if its realistic to learn enough PHP / Javascript within a year to implement midsize projects?

Thanks again for this great thread.

Rick Yentzer
Rick Yentzer
5,885 Points

+1 on the featured post idea. The voices in my head (and the ones on the internet) keep telling me that php is not the route to take. I've dabbled with Ruby, Python, & Ruby on Rails. I enjoyed them, but as Randy stated, I was building little programs instead of designing for the web.

Python? Hard? That is nonsense. It'll be a relief for you if you've been messing around with PHP. When people ask me about getting into coding I always recommend that they try programming in Python first. It's probably one of the most readable coding languages out there at the moment.

Richard Duncan
Richard Duncan
5,568 Points

PHP is on the incline according to TIOBE with Ruby trailing 5 places behind > http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

Jay Killeen
PLUS
Jay Killeen
Courses Plus Student 3,725 Points

Oh my... this has been a journey reading all this and all the other content online. Thank you all for sharing your thoughts. The stage I am at is HTML and CSS fundamentals are getting good and I want to start building web applications and dynamic websites. The PHP vs RoR debate has been difficult, so I wrote everything down to try to clear my thoughts on it. I have come from an Excel/Access data analyst background and learnt programming through Microsoft Visual Basic for Applications so I am there on the programming fundamentals, for that reason I thought I could give RoR a shot.

After reading this, I think I will start with PHP so I can use the language built for the web, trained by these guys here so I don't get any 'bad habits', PHP may be 'declining' (Google Trends) but it will give me the fundamentals in manipulating web pages and also give me server side experience (already got plans to set up a LAMP home server).

Maybe one day after I have walked this path for a while I might find you all in a RoR camp, or something else, who knows.