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

Python

Python vs PHP what should I learn to develop data based web sites? And which is the most used by the industry?

Please note that I would extend my knowledge on data base and I need help to know which direction it is preferred to go: PHP or Python.. Thanks for your help.

4 Answers

I would like to chime in as well because this is a big question I have spent a lot of time thinking about too as someone planning a career as a full-stack/back-end developer. Which is better, and which is more likely to get you a job?

In my experience, though it depends on the particular job board and the keywords you use, there does tend to be a lot more jobs for developers primarily using PHP than Python. PHP is not sexy, its not hip and its not trendy (at least that's my perception), and a lot of people seem to love to hate it (I have a friend who is a C# developer to once said "PHP developers aren't real programmers"). But the reality is that even though so many people love to hate it, it objectively dominates the web and if you get to a solid intermediate level with it and you are also comfortable with other core web technologies, you are very likely to get a job.

I took the entire Beginning Python track and started with the Exploring Flask track and hated it. Though I love Treehouse, I felt that the instruction for Python was really bad. I am someone who loves to code and can always figure out the solution to pretty much any code challenge I am given, but the Python courses had me constantly frustrated. On the other hand, the PHP instruction on Treehouse is pretty good, and if you're already familiar with JavaScript then you'll find that for the most part, writing PHP doesn't feel that different. I find that switching back and forth between PHP on the backend and JS on the frontend feels very natural. Not so with Python. Not to mention, and this is big: so use Python for web development you need a framework. But with PHP, you can just create a PHP file and easily write the PHP right into your HTML for simple stuff, no framework or third party libraries needed.

Lastly, I am always surprised to see JavaScript being recommended so often for the backend. There are jobs requiring Node and Express for instance, but again, my experience is that there are not nearly as many jobs for developers using those technologies as there are for the more traditional webstack. I am not saying don't learn Node and Express, because I plan to at some point, but I am pretty sure that my first point of entry into the job market will be with a job that primarily uses PHP and MySQL.

I hope these thoughts help.

Clayton Perszyk
MOD
Clayton Perszyk
Treehouse Moderator 48,723 Points

I would also suggest considering JavaScript. But if you are deciding between Python and PHP, I would say PHP. If you are looking to build websites, you can use WordPress, which is pretty easy to get started with. But if you want to add or modify functionality in Wordpress, you will need to know PHP, CSS, HTML, and maybe a little JavaScript.

Jeff Muday
MOD
Jeff Muday
Treehouse Moderator 28,716 Points

Yes, I would agree with Clayton Perszyk. PHP is more widely used than Python for web development. Python is a bit more of a specialist language for web, but leads in Machine Learning, AI, and Data Science. Python is also the must have language for DevOps.

If you're trying to get a job quickly, I'd go full-stack JavaScript and top it off with PHP. So many websites are using Wordpress, it is going to be around for years-- so that is a great specialization.

Thanks to everyone for your feedback, it really helps to figureout the best direction and best approach in my learning. I will go with PHP as it is a more mature and more implemented language compared to Python, I will be back to let you know my feeling at a certain point. Thanks again to you all for your valuable experience. A.hamid