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

Jeremy Coleman
Jeremy Coleman
5,449 Points

Python or PHP?

I want to be able to build blogs and online stores and feel that PHP would be my best choice, but I feel I am not giving credit to Python as much as I should. So I am looking for advice before I spend several hundred or thousands of hours learning a language just to face my fear of wishing I learned the other.

I did a little research and I know I am comparing apples to oranges. Some have good sides and others have bad sides.

Thanks for your input in advance!

4 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

In my personal opinion, I have done the basics of both Python (and Flask) and PHP. Myself, I am much more drawn to PHP. I'm really not sure why, I just seem to understand and grasp it much easier than Python.

If I were you, I would do the PHP Development Track and see if you like it. Then do the Learn Python Track.

Once you've done both, you, yourself, will be much more able to make the decision on which route you want to focus on. Each of these track doesn't take more than a week or two (with minimal to moderate study), and you should be able to feel which one is for you.

Like I said, I've done both... I'm definitely a PHP person.

:)

Jeremy Coleman
Jeremy Coleman
5,449 Points

I have done PHP but I have trouble remembering the Syntax, although to be fair I have not been very consistent with it. I'll give it another go. Thank you!

jason chan
jason chan
31,009 Points

Python and php are both good languages. One is not more difficult than the other. You can apply the concepts to both except there is few nuances.

Python doesn't have case/switch. Yeah when I found out coming from php and javascript. I was like ¯_(⊙︿⊙)_/¯

Jeremy Coleman
Jeremy Coleman
5,449 Points

So would learning both at least later on be redundant? I know it wouldn't hurt to learn both but, if they do the same thing wouldn't it just be a waste of time?

Codin - Codesmite
Codin - Codesmite
8,600 Points

Depends what your end goal is, for example if you are looking to get a job, the better of the two languages for getting a job is going to depend on your location.

For example here in London if I go to a job website there will be:

40,000 PHP Developer jobs advertised

4000 Python jobs advertised

So the obvious choice would be PHP right?

Unfortunately no, on that same website based in London there is 250,000 PHP Developers registered looking for jobs, and only 6000 Python Developers so essentially it is easier to get a job as a Python Developer here in London.

Personally I am a PHP developer that dabbles in Python every now and again, the market for PHP developers here in London is so saturated I decided to go freelance and start my own business instead.

Kevin Korte
Kevin Korte
28,149 Points

I'm curious if you're at this fork in the road, why aren't you considering Ruby too?

Jeremy Coleman
Jeremy Coleman
5,449 Points

I actually wanted to learn Ruby but after doing a little research I found that Python and PHP were more commonly used. So I figured that it would be more difficult to get a job.

Kevin Korte
Kevin Korte
28,149 Points

Fair enough, that's a good reason to to pick your language. Around me it tends to be the other way. Not much python, more ruby opportunities.

Will say this, it gets easier to learn a new language, with each language you learn, generally speaking.

Jeremy Coleman
Jeremy Coleman
5,449 Points

So if I did want to learn all 3 languages how long would you, yourself spend on learning them until you felt comfortable?

Kevin Korte
Kevin Korte
28,149 Points

Man, that's a tough question. The first language probably the better part of a year, language two and three probably at least 6 months. But that answer is a bit like throwing darts at a dart board, blind.

Jeremy Coleman
Jeremy Coleman
5,449 Points

Alright, just coming into this I am just trying to get a idea of what to expect. Thank you!