Live data from Hacker News

An Internet of PHP

timotijhof.net

191–200 of 333 posts

Re: An Internet of PHP

#191
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.

Clean???¿??????

Dude, Node is as broken as PHP. And it starts from having no standard library leading to hell like leftpad and general software supply chain holes that PHP never had in the same quantity.

It isn't clean. Node was just shinier and had more applications to leveraging it for a shiny frontend.

Re: An Internet of PHP

#192

Earlier quoted context omitted.

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.

The mere concept of a "document root" is a problem though and a major footgun if you don't know what you're doing. Every other language acts as its own web server which wouldn't even be capable of serving files even if you tried; the only thing it does is respond to web routes defined by the application. This eliminates a whole chunk of security issues, from the one described above to malicious file uploads (PHP is p…

> The mere concept of a "document root" is a problem though and a major footgun if you don't know what you're doing.

A non issue though after 2-3 days of working with this approach. All modern PHP frameworks have a so called front controller (an index.php file) that loads what it requires from ../ after, ideally, properly validating the request to avoid issues.

Re: An Internet of PHP

#193

Earlier quoted context omitted.

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.

Some frameworks in the old days of PHP relied on .htaccess files to restrict access to unwanted files. Properly implemented frameworks would load everything from a directory above the documentroot to avoid these issues.

Re: An Internet of PHP

#194

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

I wish cheap server hostings allowed loading php modules or at least had FFI module. Imagine thin php API-layer with rust-or-whatever-module under the hood. Easy deploying toys without need of VPS.

Re: An Internet of PHP

#196

Earlier quoted context omitted.

PHP was the Visual Basic 6 for web. People without proper training and theoretical knowledge just went and did stuff.

and made millions of dollars

It relocated wealth, but it did not create it.

There are lots of industries that are lucrative, but there's clearly no linear correlation to quality or societal benefit.

Re: An Internet of PHP

#197
post #144

Earlier quoted context omitted.

Can you explain why you think it’s an awful language? It definitely used to be lacking in features, but the improvements in the recent versions have been great.

Developer experience is awful. Variable names starting with $, heavy object orientism that seems like an after thought, tooling ecosystem is subpar, standard library is a joke, etc It’s a pile of crap and that’s my opinion

What’s wrong with the standard library? Seems pretty extensive. Supports all kinds of DB drivers out of the box, JSON, XML, drawing tools…

Re: An Internet of PHP

#198
post #172

Earlier quoted context omitted.

I started out as a symfony snob. Got sick of writing java in PHP so I picked up laravel. Got sick of having to modify my code every time Taylor huffed some new shit so I started building things using WordPress. It's so refreshing knowing that my websites auto update themselves and I never have to update them unless there is a legitimate reason to do so. Backwards compatibility is the ONLY thing I care about in a fram…

Symfony and Laravel have their proper usages. I used to be Symfony snob too but tried Laravel and I definitely see its strengths. Laravel was not the right choice with our homegrown, non-framework app, with an existing schema.

Yea, don't debate that. I just personally have no tolerance for the behaviour of these framework developers and the level of work they impose on their users.

For a business that has engineers to manage this day to day it's less of an issue. For building things you want to live online untouched for a decade it's just not an option.

Laravel is nice to build stuff fast in one particular way. It's awful to maintain and heaven forbid you have a different idea about how things should be done.

Re: An Internet of PHP

#199

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…

That's a fun list.

Of over 100 I have only heard of 1/3: 35 in total.

I have only ever been into and eaten anything from half of those.

So fully 2/3 of the list I've never even heard of. Interesting.

Re: An Internet of PHP

#200

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…

That quote has a really big problem.

I run a couple of services that are accesible through an API built in Symfony (PHP), but the data is generated with software built with JS (event driven -> lambda, cloudflare workers), Python (depending on GDAL mostly) and also PHP.

Post reply on HN