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.
10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?
11–18 of 18 posts
Re: 10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?
#12I'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 per…
I hear it all the time. Primarily by polyglots who are interested in prototyping things. I use both, I prefer PHP and I'm increasingly aware that people aren't learning PHP rather than watching it evolve past Python.
Re: 10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?
#13But over the years I've also inherited some absolutely abhorrent PHP nightmare projects, whose design/coding decisions truly boggle the imagination. Often based on no framework at all, and apparently motivated largely by the developer's desire to use as many PHP and SQL features as possible in the same project.
Latterly I've been using python for some web projects. I played briefly with django, but I've found myself settling on Flask [2], a very nice "microframework" which is super easy to get running with, and which gives a great balance between power and stay-out-of-my-way-ness. It has a simple URL routing system based on function decorators and regex, the ability to factor your apps into reusable components based around your python modules, jinja2 templates, etc. I use sqlalchemy for db access.
Honestly I find it much more of a pleasure to be coding python/flask vs PHP/codeigniter, but due to team and project constraints it isn't always possible to go that way.
Re: 10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?
#14I 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?
#15Re: 10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?
#16Python isn't the fastest dog out there, but doesn't fare so badly with the abstractions, and its OO style suits a dynamic language better. It doesn't try to be a Java.
Neither language will give you much protection against programming errors, nor optimize your code very well like many of the new hip languages (Rust, Go, Nim) do.
Re: 10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?
#17And then of course it's the spacing issues which is hard to understand at first glance
Re: 10yr+ PHP Dev Wondering: Python vs. PHP for Web Applications?
#18I 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.
http://jugad2.blogspot.in/2015/01/publish-databases-to-pdf-w...
PyDAL is now a separate project and can be used without web2py.