Live data from Hacker News

An Internet of PHP

timotijhof.net

81–90 of 333 posts

Re: An Internet of PHP

#81

From W3Tech; > PHP is used by 77% of all the websites whose server-side programming language we know. I had a quick look at the methodology section, but it’s not clear to me how accurate this data is. Determining whether a site uses PHP can be relatively straightforward (especially with default extensions / if Wordpress is used / etc), but if a site (potentially using a different language) is behind a reverse proxy/u…

Saying 77% of the web is run by PHP and concluding therefore that PHP is well-liked for websites is like telling most of banking is run in COBOL and therefore COBOL is well-liked for banking.

The conclusion has no coherence to the source.

I guess that most of the web runs on PHP (because it runs on Wordpress) if counted by page-view. But I'm not sure that's the proper measure.

Re: An Internet of PHP

#82
post #78

> Slack uses PHP for most of its server-side application logic […]. Slack migrated to Hacklang in 2016 [1]. [1] https://slack.engineering/hakana-taking-hack-seriously/ "We started migrating to a different language called Hack in 2016."

Isn't Hack basically compiled PHP so that it is faster for FB's use case? I understand it's not technically PHP, but I imagine it is effectively still PHP, or is it more like what C++ is to C?

I understand PHP is fast adding any actual language features that Hack has over it?

Re: An Internet of PHP

#84
post #7

Earlier quoted context omitted.

Bad rap comes from the inconsistency of the early APIs. The ability to interleave code and HTML was also tacky and never taken seriously but I think touted highly by some as a killer feature. The language is very unplanned, go look at an equality chart for PHP, it makes JavaScript blush as well.

I'd love to see a modern PHP without the language quirks and with a decent standard library.

https://hacklang.org/

Re: An Internet of PHP

#85

At the end of the day if your software works and users like it, does the programming language even matter?

It does, language comes with culture, I'm polyglot and the amount of horrors I've seen in php3/4 days was on par with legacy cobol. It was too sweet on effectful code around random maps (what's not to like, you can do whatever and spend hours trying to find the right combination of stdlib array_ functions until something happens). Of course things change after the nonphp6. But if someone only knows and love php I'll…

Yeah, the "culture" had its technical issues. But in real culture PHP people are typically good mooded, friendly and humble fellows.

So culture is a plus thing. Because the technical mishaps are there in any community with size (looking at you JavaScript)

Re: An Internet of PHP

#86

I've always liked PHP. You wouldn't pick it for your job interview's coding test if you had a choice (Python all the way there), but it's so intertwined with the internet and what we've learned about programming over the years. First mover advantage kind of deal. And I've never had to deal with ESM/CJS/AMD whatever module nonsense with PHP. No transpiling anything, just edit and refresh. And so many useful functions…

I haven't used it for a long while, but I did a LOT of PHP5, several years. In my opinion PHP4 was horrific (from a language/standard library perspective, most languages you can get what you want done regardless of that), a lot of it carried over into PHP5 despite being a lot better (e.g. see phpsadness). Then the fiasco that was 6/7/whatever made it really hard to have confidence in the future of PHP.

No idea how recent PHP is. It's hard to escape those opinions that formed fairly widely in the industry is, though.

Re: An Internet of PHP

#87

php runs securely in 5minutes in any web server 3-10$/month. Every other tech, it's complicated servers or complicated billing, not to mention depencies and build tools. thats why php

Well it's not exactly secure by default. I was deploying an app to a new server and some bot grabbed my .env file before I finished the Apache config. Ultimately it's my own stupidity, but you don't have to worry about that with most other languages

Re: An Internet of PHP

#88

I've always liked PHP. You wouldn't pick it for your job interview's coding test if you had a choice (Python all the way there), but it's so intertwined with the internet and what we've learned about programming over the years. First mover advantage kind of deal. And I've never had to deal with ESM/CJS/AMD whatever module nonsense with PHP. No transpiling anything, just edit and refresh. And so many useful functions…

PHP is akin to, I don't know, the Subway (fast food restaurant chain) of programming languages?

You don't hear too much about it. You almost never notice it unless you're actually looking for it, unlike McDonald's with its ostentatious golden arches.

It's popularity is waning. But it's still everywhere. [0] There are a hundred other sandwich chains that have tried to do it better but none have managed the ubiquity of Subway.

People like to look down on it and espouse the alternatives, but when it comes down to it fast food can only ever be so good.

I guess that means that JavaScript is McDonald's?

[0] https://en.wikipedia.org/wiki/List_of_the_largest_fast_food_...

Re: An Internet of PHP

#89
post #32
post #28

Earlier quoted context omitted.

Maybe not for the user, at least not directly, but developer experience is something to optimise for. PHP is also the one language whose choice can make an impact on users' experience, since its shared-nothing (sans caches) runtime model is almost CGI-like and can, in my experience, lead to higher latency, as each request simply does more. Maybe some experienced PHP devs can tell me how they combat this?

There are multiple options by now. For one, PHP got a JIT compiler a while ago. That, in combination with the existing opcode cache, actually causes PHP to outperform its interpreted competitors in most cases. Additionally, there are several application server strategies, sometimes with a process manager that keeps preloaded request workers at hand, sometimes hosting an event loop, and sometimes a request worker that…

And not to forget traditional web server caching. Since they mimick html files on the server, doing your app right, you can use the very mature caching options in the web server / proxies.

Re: An Internet of PHP

#90
post #82
post #78

> Slack uses PHP for most of its server-side application logic […]. Slack migrated to Hacklang in 2016 [1]. [1] https://slack.engineering/hakana-taking-hack-seriously/ "We started migrating to a different language called Hack in 2016."

Isn't Hack basically compiled PHP so that it is faster for FB's use case? I understand it's not technically PHP, but I imagine it is effectively still PHP, or is it more like what C++ is to C? I understand PHP is fast adding any actual language features that Hack has over it?

At one point it was, but since then it’s become it’s own language with a completely new (JIT-based) implementation
Post reply on HN