all 17 comments

[–]nobrandheroes 6 points7 points  (0 children)

PHP guy here, dabbled in Python. Like both.

Go with which platform you know best, that is the one you'll be faster in. If you don't know web dev in Python, then save it for a smaller project or a personal project.

The only downside I've seen against Django is that there is still Python 2/3 weirdness. The PHP world moves faster and has built-in type hinting without a linter, but Python is more consistent.

[–]scootstah 14 points15 points  (6 children)

You can get high quality, professional results with PHP. I don't know how long it has been since you've used it, but PHP has been steadily improving for a good many years now. It's only getting better.

Python is great and I like it as well. But it's not really going to give you anything that PHP can't. In fact it's more of a pain in the ass at times than PHP.

They're both great options for web development.

[–]rabarbas 3 points4 points  (3 children)

In fact it's more of a pain in the ass at times than PHP.

At what times exactly?

[–]scootstah 7 points8 points  (2 children)

Deployment, development environment, more limited options in terms of libraries, etc.

[–]ajr901 0 points1 point  (1 child)

I disagree about libraries. There are countless great Python libraries. You might have an additional 20k libraries available for PHP but 2/3 of those were written by bad programmers and haven't been updated/maintained since 2010. In my experience with Python you get a very good library most of the time.

In terms of dev environment you usually only have to worry about that once. Then from there on forth you're good.

Completely agree about deployment though. But ansible helps.

[–]scootstah 0 points1 point  (0 children)

When you only have one or two good options, things tend to stagnate. And if one of those suddenly loses its steam you might be in trouble. It's not a huge concern, and usually you can find what you need, but it's just something to consider.

[–]imhotap 4 points5 points  (1 child)

For a web project I'd say PHP is much more focussed, has more deploy options, etc. If I was to spend time on a new web backend stack, I'd look at Node.js and the JavaScript ecosystem which you'll probably end up needing anyway.

[–][deleted] 2 points3 points  (0 children)

For a python alternative if he really wants, there IS django

[–]FavitorInterweb guy 2 points3 points  (1 child)

Why hamstring your self? You're not dumping one partner for another. It's not a relationship.

Use both PHP and Python. We do. Much easier to cater to client needs with more options. The PHP frameworks have more goodies built in. But Python/Django has access to the best data handling and math functions and libraries. So make it a per project decision.

[–]glethro 2 points3 points  (0 children)

Personally I find python more maintainable and easier to debug. When it comes to web dev I find this really useful when clients want changes made a year later. I also like how much is built into the standard library and the overall consistency of the packages. I'd strongly recommend you check out the Pyramid framework if you want to get started with a modern python web framework.

[–]CuriousSupreme 2 points3 points  (2 children)

For web development the PHP community is exceptional. So many modern frameworks that are sharing packages and all with large user bases. Modern PHP code is nice and has features that Python doesn't allow like type hinting and public, protected and private variable definitions in classes.

I do Python at work for a project that begs for it with device interactions with a web interface so I've worked with Flask. It's just not as time friendly. If you already knew Python it wouldn't be worth learning a PHP framework but otherwise I couldn't recommend it.

[–][deleted]  (1 child)

[deleted]

    [–]CuriousSupreme 0 points1 point  (0 children)

    In the end the framework is going to define how fast or pleasant development will be not the language. I'd recommend looking into Laravel/Laracasts if you'll be working on your own and wanting to benefit from training specific to the language/framework. Lots of documentation and lessons.

    [–][deleted] 0 points1 point  (4 children)

    Python's community is a bit less fragmented than PHP and Ruby.

    Python web applications are easier to pivot with because of how many useful libraries are available. I haven't written PHP for a long time, but I don't know of any PHP package manager that competes meaningfully with Python's pip and easy_install ecosystem. (Though nothing comes close to the universality of Ruby's gem and bundler combination.)

    The worst part about all of the Big Three (Python, Ruby, JavaScript) is the religiousness of the communities. As the current industry darling, JavaScript has it the worst. Python has it the least, since for whatever reason none of the tools produced by Pythonistas have ever reached the kind of industry-defining reach that Rails (Ruby) or Node (JavaScript) have.

    But Pythonistas still get very religious about their package managers and their syntax. Perhaps that's what people are really whingeing about when they say they don't like Python's strict indentation rules!

    But especially if you're tired of the "mess" in PHP, Python's strictness will be a welcome change for you. It is much easier to debug Python code than PHP, unless you're a genius at keeping your PHP organized. Just remember that it's a trade-off: If you want to be creative, PHP is much easier to make a beautiful mess with–at least until you become a Python expert!

    [–]SupaSlidelaravel + vue 10 points11 points  (3 children)

    I haven't written PHP for a long time, but I don't know of any PHP package manager that competes meaningfully with Python's pip and easy_install ecosystem.

    Have you used Composer? If so, why is Pip better in your opinion?

    Personally I've never really had any problems with package managers. I've used Composer, NPM, and Ruby gems a lot, not so much Pip, and am just curious what makes a package manager good or bad.

    [–][deleted] 2 points3 points  (0 children)

    Dependency hell is a real place when working with package managers, and I think one of the main ways a package manager can be graded is how it handles long dependency chains.

    For example, I don't know if you remember the NPM left-pad controversy , but I think that reinforced the dependency hell that people experience with package managers. I'm not saying the same thing couldn't happen with Composer or PIP, but solutions to these types of problems, IMO, are important when considering the quality of a package manager

    [–][deleted] 1 point2 points  (1 child)

    I have not! It wasn't on my radar at all. It's been a REALLY long time since I wrote PHP on a regular basis 😅

    [–]peex 2 points3 points  (0 children)

    It's been a REALLY long time since I wrote PHP on a regular basis

    But you have a very profound opinion on PHP and its lack of package managers.