48
feroza
4y

PHP doesn’t scale. Riiiiiight. Wikipedia runs entirely on PHP and is the fifth most visited site on the internet. There’s also this little site called Facebook that uses PHP, ever heard of it?

PHP is slow. Sure, old PHP can be slow. The argument is about as sound is saying that OS X is a terrible OS because my first Apple IIe was slow. PHP 7 is plenty fast, even three time faster than Python.

https://hackernoon.com/php-is-dead-...

Comments
  • 17
    Lots of people hate on shit because it's trendy and cool, or because they used it once 7 years ago and hated it.
  • 6
    Don't know about Wikipedia but Facebook does a lot to optimize his stack, has dozens of other technologies intertwined (yes PHP is one of them) so it ain't a fair comparison.

    My guess is people don't like PHP because of the developers not so much because of the language, although it does have its flaws.
  • 2
    @JKyll Facebook was built in PHP - they switched to Hack (still PHP-like) when they were already a huge service.
  • 16
    @mlask it didn't scale thanks to PHP it scaled in spite of it, Facebook has made huge contributions to improve PHP and has combined a lot of tools with it, if anything Facebook is a statement of great DevOps.

    Programming language debates are nonsensical by those standards because there are probably lots of success stories for the most used programming languages, which PHP is part of. Not because it was a great language but because it came free & fully supported with Apache and could be embedded easily, allowing the then web designers (graphic designers) to create dirt cheap sites with copypasta code for common tasks with no standards which was made worse after the WordPress boom when thousands of new "enganeers" contributed to a decline in web dev salaries and PHPs reputation today, i.e you can get almost any site "developed" in WordPress by Indian freelancers for no more than 50 bucks.

    PHP is not bad necessarily, it has won it's reputation unfairly thanks to former devs.
  • 6
    But OS X is a terrible os…
  • 4
    @Stuxnet Or maybe they hate how the standard library is a mess and a default installation doesn't properly show errors resulting in a white page.
  • 2
    @inaba lots_of_people != everyone
  • 0
    @irene this is what's used in the article https://hackr.io/blog/...
  • 0
    @Stuxnet yes, like 3 people fit your strawman
  • 4
    @inaba lmfao no.

    My comment isn't specifically about PHP.

    People definitely hate on shit because it's trendy. Remember the day MS bought GitHub? Half this community was up in flames bitching about privacy and God knows what. Guess who still uses GitHub? Pretty much everyone of them.
  • 0
    Also the article is pretty bad given it relies on something that it's unwilling to actually demonstrate. Like just this alone

    > It looks like ‘PHP is dead’ blog posts started cropping up in 2011

    seems like a pretty dumb thing thing to say without actually demonstrating the existence of those blog posts. And even then the opinion of like 5 bloggers would seem like a rather silly thing to write such an article about
  • 3
    @inaba
    > PHP is slow. Sure, old PHP can be slow. The argument is about as sound is saying that OS X is a terrible OS because my first Apple IIe was slow. PHP 7 is plenty fast, even three time faster than Python.

    The article behind the claim does not show a single benchmark at all, so the argument is a bit "weak".
  • 0
    @sbiewald haha holy shit it doesn't 😂
  • 0
    @Stuxnet yeah and again, that's like 5 people. Or maybe 10. Whatever, there were still plenty of posts that had reasons why they didn't how Microsoft bought github. (And a tonnes of memes when you search "microsoft github").

    > Guess who still uses GitHub? Pretty much everyone of them.

    And another baseless generalization. 200iq right there
  • 3
    @inaba how hard is it to modify the debugging line in the ini file?

    Lmao. The reason is because you don't want debugging in your production server, so php let's you choose exactly what type of debugging you want displayed with 1 line of config.

    It's fucking unreal that this is the reason you don't like PHP.
  • 3
    @sbiewald you can google the benchmarks. PHP7 is stupid fast, and is now the default for all major web hosts.
  • 2
    @sbiewald @irene Here are some benchmarks:
    https://benchmarksgame-team.pages.debian.net/...

    Feel to google for more benchmarks yourself, the results are similar.

    Python and Ruby are both mediocre performers, so I don't see why this suprises anyone.
  • 0
    @dangerzone not very hard, which is why errors should be turned on by default. Your argument goes both ways.

    Nah there are plenty of other reasons to critisize the language lol
  • 3
    “PHP is 3 times faster then Python”
    That’s the entire argument? 😔
    You made me read all that just to come out empty handed 😦

    Bloody click bait shit, this is why I don’t use FB or read “so called devs” blogs, it’s useless incompetent half factual shit with a hint of truth sprinkled on top.
  • 3
    If PHP is that much better than Python then why didn’t they just migrate Instagram over from Python 2.7 instead of spending months on the Python 3 switch?

    I’m pretty sure Facebook remained PHP (which is actually compiled by HHVM) for legacy reasons.
  • 1
    @620hun this, sums up my argument that you can scale on almost any language. Instagram is made on top of Django...let that sink in.
  • 2
    Why do you people ranting on php focus on trivial things like performance, which can be solved by adding more servers, but go pass the really annoying things like inconsistency in command naming and parameter order, or the language getting more and more bloat around new features. The code is way more verbose than Java 8 with lombok. Why don't you rant on projects that encourage bad practices (like wordpress with its love for global variables and replacing idea of namespacing with checking if funtion exists by its string name. There is still. No decent way of handling websockets or any long running code. Is php still allowing only one execution thread like it did decades ago? With all that effort on promoting the reactive paradigm in the J languages? If someone creates a there-and-back transpiler for php and is typescript-like counterpart, he would greatly improve overall experience of programming in php.
  • 0
    Keeping the support for legacy things like autoinitializing all input values while dropping old external libraries like replacing mysql with pdo. This kills opportunity to run old applications when required.
    Add the amount of the configuration you have to provide to make everything working is insane.
  • 3
    @mt3o To be fair, criticising WordPress is like kicking someone while they're already lying down.
  • 0
    @Python I thought they are overall quite good regarding development and community 😂
  • 0
    PHP isn’t bad - Wordpress is bad. There are very good PHP projects out there and scaling is rarely an issue because of PHP itself but almost always bad Code or idiotic database connections.

    You should Code in whatever you like. If you hit a performance wall due to the respective language barriers, you should always keep in mind that a metric fuckton of users are using your application.
  • 0
    I use the Phalcon PHP framework which a full-stack PHP framework delivered as a C-extension. This makes everything extremely fast compared to other PHP frameworks/web applications
  • 2
    FB is a buggy and slow piece of garbage.
  • 1
    @electrineer Yeah, the client-side is slow and buggy because of PHP. Definitely not JavaScript.
  • 0
    I used to do plenty of PHP development (and I still do sometimes), even writing native extensions in C / C++ for some things where performance was critical. And I have to say speed and and scalability are actually PHP's strong points - especially the latter, as PHP is stateless by design and you can deploy an arbitrary number of instances.

    There are other reasons I hate PHP:
    - constant syntax changes - I've had to rewrite MySQL connection first for MySQLi, then for PDO; same goes for MongoDB, and a bunch of other stuff, including package management (remember phar&pear?)
    - lack of tooling - it seems like there's just no way to properly lint & autoformat PHP code, and any tool that actually provides those functions is limited to a predefined set of code styles and rules
    - some configurable rules have to be set at compile time
    - namespaces are global across imported files and there's only limited type safety, which makes it nearly impossible for IDEs to provide good code completion
  • 0
    Furthermore, nothing seems to be tested - Laravel only does code style check on push / merge, WordPress doesn't even have automated tests, and some other popular frameworks that do have tests have darn low code coverage.

    One more thing is the lack of ability to run stuff in the background; while the article mentions Magento as a viable shopping platform, it fails to mention you need a pretty good server to actually run it, and you need to install background jobs while other apps can schedule and run them internally.

    If the point of this article is that PHP still offers everything average Joe needs (and average Jeff has to program), then it's true, and numbers from my servers back that up - 100 / 130 sites use PHP. Most of those were made by a junior / mid dev, and the customers are happy. However, none of those 100 sites brings in any real money, because [plenty of PHP devs; free frameworks with GUI; projects with no need for TDD & DevOps] just don't make up a lot of added value.
Add Comment