Live data from Hacker News

10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?

news.ycombinator.com

1–10 of 18 posts

10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?

#1
10yr+ PHP Dev wondering: Python vs PHP for Web Applications? Please don't let this drag onto a bitter fanboy debate about which programming language syntax is better...I just want to hear your story if you have used both PHP and Python in your web development years.

Re: 10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?

#3
I've used both, but I can't answer this without knowing what you want to use it for.

I don't know that I've ever heard anyone say that they prefer PHP over Python, so I doubt you'll get that response on here.

I'm honestly not a huge fan of either. Are you deciding whether to learn Python? What you want to use going forward?

Honestly having 10+ years of PHP experience probably makes it a hands-down winner (for you personally) in terms of productivity. It'd be a while before you'd see any real productivity gains from Python.

That said, there are maintainability considerations for each language, and Python wins in some of those categories.

Re: 10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?

#4
If you're talking frameworks, I prefer Python. Django is a juggernaut and getting better and better with each release. PHP frameworks come in all shapes and sizes, but I haven't found one that feels as comfortable as Django. If you're taking a generally static site though and need a few bits of dynamism, I'd stick with PHP as it'll be lighter and get the job done fine.

Re: 10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?

#5
I was a PHP dev for ~6 years, switched to Python about a year ago.

* Once you know PHP, it's really fast to get shit done. Can't deny that.

* After staying with one language for so many years, it's crucial to try something new. You might not like it, but there might be some parts that could inspire you. It's really toxic to be stuck in one mindset for a very long time.

* Anecdotal, but I found an average Python dev to be better than average PHP dev (oh god, all those custom PHP frameworks I had to maintain and rescue projects from death).

* Python has great libraries for statistics, machine learning, image processing, etc - it's very universal.

* There is loads of great info about Python on the Internet and transition should be smooth once you get used to not putting semicolon ;)

* I found that there are more better paying jobs in Python.

All in all, why not to try?

Re: 10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?

#7
For mass hosting of web applications written by untrusted 3rd parties I like PHP better because I can restrict what they can do via php.ini and there seems to be better support for static analysis.

That said most of the stuff I write myself lately is in Python.

Re: 10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?

#8
I don't use PHP at all, but one thing I envy PHP (and Perl) users is that they have excellent libraries to interact with SQL databases in the form of PDO (PHP) and DBI (Perl). There's no direct equivalent of this in Python which is a shame. The mantra in Python land is to use ORMs which I am not a fan of.

Re: 10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?

#9
post #8

I don't use PHP at all, but one thing I envy PHP (and Perl) users is that they have excellent libraries to interact with SQL databases in the form of PDO (PHP) and DBI (Perl). There's no direct equivalent of this in Python which is a shame. The mantra in Python land is to use ORMs which I am not a fan of.

Have you checked web2py with its DAL? you can get it also as a standalone module https://github.com/web2py/pydal Also there is db.py from yhat.

Re: 10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?

#10
post #8

I don't use PHP at all, but one thing I envy PHP (and Perl) users is that they have excellent libraries to interact with SQL databases in the form of PDO (PHP) and DBI (Perl). There's no direct equivalent of this in Python which is a shame. The mantra in Python land is to use ORMs which I am not a fan of.

I don't necessarily like it as much as DBI, but I find Cx_Oracle easy enough to use.
Post reply on HN