Live data from Hacker News

An Internet of PHP

timotijhof.net

131–140 of 333 posts

Re: An Internet of PHP

#131

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

So it wasn't the language, it was you? But it was the language?

Re: An Internet of PHP

#132
post #39
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.

> The language is very unplanned, go look at an equality chart for PHP, it makes JavaScript blush as well. This has been fixed in PHP 8. https://wiki.php.net/rfc/string_to_number_comparison

> make non-strict comparisons more useful and less error prone, by using a number comparison only if the string is actually numeric. Otherwise the number is converted into a string, and a string comparison is performed.

That… makes it even worse.

Re: An Internet of PHP

#133

Earlier quoted context omitted.

Not sure why it is downvoted as this is true. That said it is more to do with shared hosts culture choosing PHP than PHP itself. (They tend to support Ruby and Node but not as well)

PHP is also pretty easy to support for shared hosting, as what they essentially need is just an Apache module (+ nginx probably), some clever filesystem permissions and they're done. For node, Python, etc, you actually need to keep the application servers running, which has to stay running even when they're completely idle. So I think PHP is a natural choice for shared hosting for those reasons too.

> For node, Python, etc, you actually need to keep the application servers running

Not with CGI.

Re: An Internet of PHP

#134
I’m quoted a bunch in this, which I appreciate, but there’s one mistake here — Slack no longer uses PHP, having migrated its codebase to Hack.

Also listing language usage by what’s returned in server headers undercounts languages used on some of the biggest, most popular internet properties.

Sites like Amazon, TikTok and YouTube/Google consume a lot of our total attention, but they tend not to report their backend server languages in response headers.

If you shift from raw numbers to where people actually spend their time, I doubt PHP would be at the top.

Re: An Internet of PHP

#135

Earlier quoted context omitted.

> The ability to interleave code and HTML was also tacky and never taken seriously And yet people would take a bullet for React and the JSX templates.

JSX and PHP are actually seriously different. When you break out of PHP, you're just outputting text to standard output. When you're using JSX syntax, you're constructing Javascript objects that can be manipulated using standard javascript techniques. Anyone who believes they're comparable seriously doesn't understand the task that is before them.

Oh please, I professionally use both daily (enjoy them both), but even I can see JSX is just PHP with extra steps.

Re: An Internet of PHP

#136

Earlier quoted context omitted.

Funny how "server side rendering" became a hot new thing too. I was so confused when I heard that, "like... a HTML file?". Keep going at this rate and we'll be using frames again.

> "like... a HTML file?" Serving a static HTML file is not server-side rendering. It's much dumber than that. The people advocating for SSR want the server to respond with HTML generated based on whatever is in the request.

So like PHP?

This thread is so cope.

Re: An Internet of PHP

#137
post #120
post #119

As an ex-PHP developer (almost 10 years now), I do not miss it. As a language, it is a scripting language with an okay interpreter. But as an eco-system, it is a hot mess. It has both the worst software developers (and I was one of them) as well as the worst clients (and the cheapest, regardless of geography). It is not a surprise that PHP is running the web. That's because WordPress made sites/e-commerce accessible…

Modern PHP may as well be a new language. But then node came along. It's almost like PHP users couldn't stand a clean ecosystem.

I don't think the language is the problem. As bad as it is, it is certainly more well thought that the original JavaScript. But PHP is used mostly by "businesses" with no budget and this is essentially the absolute rock-bottom of the "software" industry.

Re: An Internet of PHP

#138

Earlier quoted context omitted.

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

Yes but that’s a framework specific issue. And usually your documentroot would point to a directory below that which holds .env. Oh the memories of apache and php.

Your comment makes no sense. How is that framework or PHP specific? Its simply a misconfiguration the server.

Re: An Internet of PHP

#139
post #134

I’m quoted a bunch in this, which I appreciate, but there’s one mistake here — Slack no longer uses PHP, having migrated its codebase to Hack. Also listing language usage by what’s returned in server headers undercounts languages used on some of the biggest, most popular internet properties. Sites like Amazon, TikTok and YouTube/Google consume a lot of our total attention, but they tend not to report their backend se…

Hack is a “dialect” of PHP created by Meta to be more performant and have types, among other features. So its not like they shifted their codebase to an entirely new language.

Re: An Internet of PHP

#140
post #120
post #119

As an ex-PHP developer (almost 10 years now), I do not miss it. As a language, it is a scripting language with an okay interpreter. But as an eco-system, it is a hot mess. It has both the worst software developers (and I was one of them) as well as the worst clients (and the cheapest, regardless of geography). It is not a surprise that PHP is running the web. That's because WordPress made sites/e-commerce accessible…

Modern PHP may as well be a new language. But then node came along. It's almost like PHP users couldn't stand a clean ecosystem.

NodeJS is the new PHP aka it's the first language someone who want to "web stuff" pick up. A decade ago most blog post about PHP had major security issues because the people who wrote those posts were just learning the ropes and copying each other in the same way most tutorial about react these days don't care about cleaning themselve up, unit testing and all that stuff that make the difference between a cowboy and a software made with quality in mind.

The state of JS is maddening, whoever spit on PHP but love JS will need to explain why an hello world from create react app has 800 dependencies in the node_modules, why do we keep using babel when most browser is already supporting es6 fine and why do we have some many way to import modules. PHP had its issues which got fix over time but we can't say the same with JS.

Post reply on HN