What to Learn PHP or Python..?

What you prefer to learn.?

  • Python

    Votes: 69 75.0%
  • PHP

    Votes: 23 25.0%

  • Total voters
    92
For IM I think you should learn php, because python is used in machine learning and deep learning
Again, flawed logic. Python has frameworks like django and flask, which are awesome for building websites pretty quickly; given that you know what you are doing.
 
Hello All,

In all aspects (Resources, Functionality, Job/Freelance Work, Support) which one should learn, Python or PHP.?

Need expert suggestion.?

Thanks
You should learn PHP and JavaScript and HTML and CSS. The bulk of programming is HTML, CSS, and JavaScript.
 
Want to build sites and don't care about data science (bots, AI, crypto trading, web scraping..): Go PHP, care about one or all of the things in the brackets more than building sites: Go Python.
 
In school We started with python, it's really good to automate things and stuff!
 
Python is really simple and easy programming language. I recommend python.
 
I wouldn't start learning php in 2019 If I were you I'd go the javascript / node route.

Python's saving grace right now is the ML stuff if it wasn't for ML I'd be avoiding it for projects which required performance.
 
You should learn PHP and JavaScript and HTML and CSS. The bulk of programming is HTML, CSS, and JavaScript.

Html, css are not even programming languages. And website programming as a whole is a tiny fraction of programming as a whole

@OP : You should learn both at least! One for scripting, the other for web developing
 
If you will keep using wordpress in the next 10 years, and still want to do things related with website, web development, then PHP first.

Python is cool because its simple, easy to learn, and very widely used, but not that well fit for the web development and let alone, wordpress. Python is mainly for versatile usage, web scraping, machine learning, etc.

Wordpress is what you should consider mostly, because nowadays, people just use wordpress, in any given time, u can develop themes, plugins, codes snippets, fix things of wordpress using PHP is, that is awesome.
 
No one mentioned insane performance increase in PHP 7.3 version. Also, it's really hard to avoid PHP if you're trying to be involved in e commerce (Wordpress - Woocommerce, PrestaShop is both written in PHP)

Python is really great for Data science, analyzing stuff. matplotlib is great. Also, you can build your whole tech stack with web framework like Django. And Python is primary choice to anything AI (Machine Learning, Nature language processing). PHP can do it too. But all of the the good tutors on the internet goes with Python for machine learning stuff. (Mainly TensorFlow, which is also available in JS now)
Also, it's not that easy to jump in and write a really good pythonic code. Contruary to everyone's "oh Python's so easy to learn!". Yeah, until you have to maintain the codebase and you're fcked with your spaghetti code. Takes time and a lot of learning to write good code.

So choose the tool for the job and resourses you have. PHP stuff is easier to host, because it's really common thing to do. While Python web app might have a bit longer learning curve. (not hard but still. more research)
 
The practical answer should be: Learn to program first, then start considering which languages.
 
The practical answer should be: Learn to program first, then start considering which languages.

Now how would you do that?

What confuses me is that people are saying that Python is excellent for ML and data mining and scraping. Python can do ANYTHING and more that PHP can do. Python is excellent for such things like ML, etc. because there are tons of libs there, but telling that to a person who is trying to figure out what to learn is a terrible idea. It may scare the person, and then they are missing out a fantastic language, and they get the wrong idea.

Here's the thing. You should pick a language based on what you are planning to do. If you are working more with PHP based software (Wordpress plugins, etc.), go with PHP. If you want to write all kinds of cool stuff including websites, apps, desktop software, whatever then you can go with Python. Both are awesome languages, but you need to figure out what you want to do and do your research because like 70% of replies are bullshit in this thread.
 
@K.H.R Why do you even want to learn? For what reason? There are many languages so why are you choosing between PHP and Python?
 
Python or if you'd pick another, probably Golang.
 
Python. It became #1 for machine learning (mature tools: tensorflow, keras, pytorch, scikit-learn), great for automation (selenium), and good for quick web apps (flask). With PHP it will be more challenging to make a good money, or progress beyond web apps.
If not python, consider JS (+node.js).
 
Python. It became #1 for machine learning (mature tools: tensorflow, keras, pytorch, scikit-learn), great for automation (selenium), and good for quick web apps (flask). With PHP it will be more challenging to make a good money, or progress beyond web apps.
If not python, consider JS (+node.js).

Here's an interesting perspective to your post.
What if I code the whole web interface in PHP, but code the "business part" of the app (let's say, it's a scraper or something..) in python? In order to get the data, the PHP script will run the python app and fetch it's output (through let's say.. exec)..

Here's the thing people miss. It is not mutually exclusive that you either use python, or you use PHP. You can use both!
I would give an example of this. I wanted to make a SAaS platform. I am well versed in flask and I knew that I could use it to make the site. Still, I went against the idea and used PHP's Yii framework to do the job. Why? That is because of the time it takes to code everything. There will be a big difference in time if I use Yii; because of it's bundled CRUD generator. I would still use python for the business logic. It will run as cron and do the needful. PHP will handle the users, interface and so on.

My advice to everyone is, that use the best tool you can get for the job. Don't stick to something just because you think it will do the job. Also, don't be afraid to use multiple technologies in the same project. ;)


PHP if you're suicidal. Python or JS if you're not.
LOL that is so NOT true. Any language is suicidal if a n00b uses it. PHP is excellent for Rapid Application Development. I don't understand why it gets so much bad rep.
 
Last edited:
I don't understand why it gets so much bad rep.

Because it used to suck because it was slow and has quite inconsistent style and it can produce some really nice cryptic error messages.
These days, it's still quite inconsistent, but with PHP 7 it's not slow anymore. It's no C or C++, but it is a lot faster and efficient than before. So most new programmers just read old rant and think PHP sucks.
 
Python is preferable because it is easy to learn and second thing about it is you can develop and kind of application using it.
 
Back
Top