r/PHPhelp • • Mar 23 '23

PHP vs Python

PHP and Python are popular programming languages but have different strengths and weaknesses. So which one should I choose from?

0 Upvotes

18 comments sorted by

View all comments

6

u/itemluminouswadison Mar 23 '23

i do both daily and i prefer php, i'd think. it's a little more classically OOP. less behind the scenes magic. init files that do things you weren't aware of. also, docstrings under the class name (wtf) vs php docblocks on top of the class name

can't go wrong with either one, though.

think about where you'd wanna see yourself in 5 years or something and look at the job market for what languages they're hiring for that. that's the most important thing imo

4

u/hedrumsamongus Mar 23 '23

PHP's my primary, and I've been getting into Python a bit more recently to do serverless stuff. I find that the PHP ecosystem is much simpler to get up and running with, and I like that the structure of the application is defined by where you tell Composer your namespaces are and where you tell your webserver that the public root directory is. All very explicit, Composer's dead simple to set up and does so much heavy lifting for you! I'm still a bit confounded by how difficult it is to get Python to import a module that I've written (but not packaged and installed) located in a sibling directory.

Either language you pick can get most jobs done, of course. The real question from a career standpoint is whether someone will pay you to do job X with language Y.

1

u/v1adxyz Mar 23 '23

Thank you!