Hacker News new | ask | show | jobs
by mgaunard 778 days ago
Why would you use PHP when Python exists?
1 comments

It's a better language. Better performance, better typing, better syntax, and so on.

Build an application in Python, then as soon as it becomes pushed by load you're going to need a rewrite. A few small load balancers and virtual web servers doing PHP can handle tens of thousands of requests per second, the database is almost guaranteed to be the bottleneck.

Python is a (according to some) nicer bash, it's not a good alternative for implementing non-trivial systems and web services.

As a longtime PHP developer, my opinion differs from yours regarding PHP vs. Python syntax.

Python took some getting used to, but the more I used it the more strongly I began preferring its lack of things like curly braces, semicolons, even parenthesis in some cases. Because of that, python feels more concise, human-readable, and more efficient to write, than PHP.

I like both languages, and still rely on PHP for a lot of web work, but for data science or ML I do end up enjoying my time with python.

PHP syntax makes it relatively easy to do ad hoc code generation, for example.

Right, Python has a purpose as a glue language.

Python is the world's most popular programming language and a true general-purpose language usable for any application.
Is that meant to be a joke?
It is an undeniable fact, the numbers don't lie.
What numbers? The amount of operating systems and drivers implemented in Python?