PHP vs. Python (Django)

Which one is better for web dev, Sup Forums?

oh dunno, maybe the one that was fucking specifically made for web dev you fuckface

Django

Anyone that says otherwise is a pajeet

PHP.
So many things can go wrong with python and its not well documented so you will lose time trying to fix it. In web-development a few minutes of down time could cost you millions if not billions.

> Pros of PHP:
Nearly every single hosting company supports it, a large number of frameworks (Laravel, Codeigniter, Yii, etc.) and CMS's built with it (Wordpress, Drupal, Joomla), If you're planning on starting a company you can usually pay PHP developers much less than Python devs (at least where I live).

> Cons of PHP:
It is an objectively ugly language with inconsistency strewn all throughout it. Many developers who know it hate using it for this very reason. PHP is flexible to the point that it allows you to write extremely messy, ugly code without enforcing any kind of structure.


> Pros of Python:
Python is generally cleaner and more readable than PHP. Several solid frameworks exist for Python as well (Django, Flask, Pyramid). I personally feel like building apps/sites with Python is more structured and straightforward than PHP.

> Cons of Python:
Less hosting options than PHP by far. If you're like most web devs nowadays who only care about the speed of the language/framework, Python will be very low on your list. Then again, PHP is not considered "fast" either, but most benchmarks show it can be faster than Python in some situations.

Personally, I would pick Python. PHP is badly designed and can be extremely frustrating to work with. Python is, in my opinion, a much stronger language and documentation for most Python packages/framework are some of the best I've ever seen (try finding a framework with better/more documentation than Django).

>>> ...cost you millions if not billions.
Pretty sure this guy isn't Mark ZuckerJew you fuckface. A few minutes won't cost him anything.

what if he makes the next facebook but a server outage at the early stages kills his project.

that is not real cons of php

learn the language and you will make blazing fast stuff unlike with python

What can "go wrong" with Python that won't "go wrong" with PHP? Python has way better documentation and it's much more consistent than PHP.

>PHP.
>So many things can go wrong with python
top kek

Inconsistency is an objectively bad trait, it makes the language harder to learn and use.

"Blazing Fast stuff" isn't needed for the vast majority of use cases. If you're building a real-time app both PHP and Python are both horrible choices.

He's not wrong. If your company is big enough to the point where you're receiving a couple hundred to a couple thousand requests per minute, being down for even 30 minutes can cost you millions of dollars, billions if you're big like Zuckerjew

Okay, but consider the fact that Django was developed for news sites, where short deadlines are common. Python is perfect for this because you can do so much with so little. Sure it might not be faster in production, but I've seen a one-liner take the same amount of time as a 16 line script I wrote. ( vs. )

Also thanks for the list, but I'm not planning on hiring anyone. Still though, I got some good info out of it. It's just for a little project I want to do.

The language is hardly a problem to a good developer. Most if not all things can be handled equally with Python and PHP, its mostly by preference.

Both have their own quirks and boons and have roughly the same runspeed (python3 and php7)

Python is a general language that suits almost any job where as PHP was built for the web. This can be a good and a bad thing depending on how you look at it.

Theyre both really easy and quick to learn, so knowing them both is also an option, selecting the right tool for the right job is the ideal thing to do.

python might be but all the frameworks are not that well documented and are prone to crashes. PhP is built for web-development and has some error corrections that python dose not.

you people are fucking retarded

Laravel is the only answer

Obviously PHP. It's what is was made for. And shitty code is a problem with shitty coders. Don't blame the language for allowing it.

>Obviously PHP. It's what is was made for
That doesen't quarantee anything though, no matter how much you try it might still turn out to be whatever

The language has some major caveats that even though not a dealbreaker for many, should not be hidden. The language has some major inconsistencies with itself and has some poorly documented mechanics that might result in unexpected behavior.

Do you really have to choose between just these two? If you can use Python, you can probably use Elixir and Phoenix, which are amazing.

Django and Pyramid have some of the best documentation around. Are you drunk?

>unexpected
If you're a crap coder, sure. PHP is superior for database interactions and handling user inputs.

You really should not have to know how the language itself works in order to operate it.

Not to mention its inexplicable error handling when it DOES give you errors.

Try figuring out what the error T_PAAMAYIM_NEKUDOTAYIM means?

> not know hebrew

>PHP is superior for database interactions
Gotta love me them SQL injections that's a hallmark of enterprise PHP.

Friendly reminder that PHP used to use strlen for function hashing. That means that the function foo() is the same as bar() because they have the same length. That's why lots of PHP functions have inconsistent names, like strpos, str_rot13, bin2hex, strtolower, recode_string, str_shuffle

found the PHPajeet

I literally never hear of PHP in job postings anymore. Also only used it like in one class at uni. Python is everywhere so I dunno is PHP old and dying now?

...It depends on the project requirements, like anything else.
Also, you're probably not aware of this, but there are multiple Python web frameworks which are not Django.