5 ms·
I'm currently working on a team that switched from PHP to Python+Django for web application development a little over a year ago. Since I've been writing Python
by rcoder 17y ago
I'm currently working on a team that switched from PHP to Python+Django for web application development a little over a year ago. Since I've been writing Python code longer than PHP (8 years vs. 6 or so), I can't really speak personally about what the transition is like, but I can tell you about what I've observed and heard from other members of the team.
In general, the Python language and tools tend to steer you in the direction of writing cleaner, better-structured code. Working with Django also gives you access to a lot of decent 3rd-party applications that you can integrate into your project, and the Python stdlib absolutely dominates PHP in terms of scope, quality, and consistency. Having the bytecode compiler and libraries that provide better data structure and algorithm in app servers also opens up the door to a whole bunch of performance optimizations that are difficult to accomplish with PHP.
That's not to say that the Pythonic way is always better, of course. PHP encourages a very iterative approach to development -- at a basic level, you're creating a static page, then incrementally adding dynamic behavior until it does what you need. Python apps tend to put the code front-and-center, and output HTML (or JSON, or XML, or whatever) as a last step in the process. In the long term, that's usually a Good Thing, but it can make the prototyping and learning processes longer for some people.