Live data from Hacker News

Four ways to build web apps

tomhummel.com

31–40 of 181 posts

Re: Four ways to build web apps

#31

Blog posts like this always strike me as…weird. This seems like “how to build a web app for a very tiny subset of people who don’t want to learn about deploying web apps”. Maybe I’m in a bubble? It seems like 99% of the people I know actually running profitable companies have an infrastructure that roughly matches to “some Linux server somewhere”, and then upward from there it all just moves to AWS/azure, but it’s st…

I read it differently. It looks like a good outline of 4 basic approaches to building and hosting web sites. I would word them as: 1. Stateless static site. There is a variety of ways to build it (such as React or Svelte or purely by hand) and a variety of ways to host it (such as a directory of HTML files hosted by nginx). 2. Function services like Cloudflare workers, AWS Lambda, Google Cloud Functions, Azure Functi…

I can't have my database on a separate Linux box? Seems odd to insist on either precisely one server or go straight to container orchestration.

That said, I agree with you about the other generalisations!

EDIT: actually, where do PaaSes fit into this taxomony? I'd argue that level 2 is actually the PaaS level. You might choose an edge PaaS (Workers), distributed (Fly.io), or centralised (Elastic Beanstalk) depending on your needs. But ultimately this level is: "I write code, you run it". FaaSes are a subset of PaaS providers which focus on stateless models, but there's no reason you can't combine FaaS for your code with a managed database offering.

Re: Four ways to build web apps

#32
post #22
post #18

Why not PHP on a shared or dedicated hosted server?

I wouldn't recommend PHP to anyone who isn't already invested/emerged in the language. Wordpress for blogs or websites on a shared host with automatic updates and a few select plugins? Yes. Laravel or Symphony for applications? Ok. But just PHP has way too many footguns and doesn't provide nearly enough affordances to make them worth it IMO. Plus it's a language that breaks backwards compatibility way too often, stop…

> Plus it's a language that breaks backwards compatibility way too often

I havent ever had any PHP code I wrote get broken by a PHP update in over 20 years.

PHP is still the simplest way to get any API going.

Re: Four ways to build web apps

#33

Blog posts like this always strike me as…weird. This seems like “how to build a web app for a very tiny subset of people who don’t want to learn about deploying web apps”. Maybe I’m in a bubble? It seems like 99% of the people I know actually running profitable companies have an infrastructure that roughly matches to “some Linux server somewhere”, and then upward from there it all just moves to AWS/azure, but it’s st…

[deleted]

Re: Four ways to build web apps

#36

Well there's also another, more oldschool, option - distribution via floppies and CDs. Lot of good zines were distributed this way. Just joking. On a more serious note - it is good to be aware and track how much we are tied to a given service. Because we might end up being taken hostage by the Cloud provider who can extort us for a long time before we manage to migrate.

[deleted]

Re: Four ways to build web apps

#37
post #27
post #22

Earlier quoted context omitted.

I wouldn't recommend PHP to anyone who isn't already invested/emerged in the language. Wordpress for blogs or websites on a shared host with automatic updates and a few select plugins? Yes. Laravel or Symphony for applications? Ok. But just PHP has way too many footguns and doesn't provide nearly enough affordances to make them worth it IMO. Plus it's a language that breaks backwards compatibility way too often, stop…

> Plus it's a language that breaks backwards compatibility way too often Do you have examples of such compatibility breakages? I noticed Nextcloud and WordPress both seem to lag behind the last version of PHP a bit. But on the other hand I also see such thing in the Java World where people are stuck on Java 8 or 11, when backward compatibility is one of the strength of the language. I also have PHP scripts I wrote fo…

> Do you have examples of such compatibility breakages?

The wordpress integration test suite broke with PHP 8.0. They seem to be lagging behind for 8.1 and 8.2 as well. Remember new keywords were introduced and code just breaks in weird ways since these versions if you have conflicting names or depend on any library that has conflicting names.

There was a somewhat recent article that talked about changes for a string template literals cleanup for the next major version that will break a whole bunch of code as well.

In the near future you won't be able to assign new properties on instantiated objects anymore. Think anyone who is creating objects dynamically to be encoded as JSON, rendered as HTML, XML or generating them from parsing/reading any of those things. I expect a lot of breakage and patches here.

> I also have PHP scripts I wrote for PHP 5.1 and still work unchanged on PHP 8.2, 12 years later. Well, I had to fix some warnings for completely dumb things I did like putting mandatory arguments after optional arguments and I'm not sure why it was working, but the upgrades have been painless for me.

In many cases the warnings, improvements and deprecations make sense. If you have a few PHP projects and use decent tooling you can fix those things often easily and are sometimes glad for it. There might be hidden bugs that are discovered that way.

But what about many projects? What about transitive dependencies?

PHP is moving fast and makes no excuses. It's simply not a language that prioritizes stability. Often for good reason, but you have to ask yourself it the churn and instability is worth it.

> Plus, I find the latest PHP version quite pleasant, with the type annotation and other new features of the language, and the execution model where your app doesn't run all the time, its php files are just called by the web server (though php-fpm).

I agree on that last part. That's where PHP shines uniquely IMO. It's really optimized for stateless execution, which makes it very easy to reason about on a macro level.

But on a micro level it's tough. There are so many little gotchas and weird behaviors. A death by a thousand cuts.

Re: Four ways to build web apps

#38
post #2

This is a nice little overview that is not afraid of being opinionated. It leaves out some of the affordances that CF Pages, Vercel and Netlify provide. (Discussed as option 1 in the article). Those are of course moving targets that provide more stuff every few months.

[flagged]

ChatGPT detected

Re: Four ways to build web apps

#39
post #22
post #18

Why not PHP on a shared or dedicated hosted server?

I wouldn't recommend PHP to anyone who isn't already invested/emerged in the language. Wordpress for blogs or websites on a shared host with automatic updates and a few select plugins? Yes. Laravel or Symphony for applications? Ok. But just PHP has way too many footguns and doesn't provide nearly enough affordances to make them worth it IMO. Plus it's a language that breaks backwards compatibility way too often, stop…

Comparatively speaking PHP has likely the most backwards compatibility with respect to actual wall time when compared with other common options.

It has many tools for the competent and the incompetent.

I'm sure your personal experience sucked, just like many people's personal experience with Java.

But let's not conflate the output of some set of practitioners with the design of the language. The fact that php can be so accommodating to the incompetent can be seen as a virtue. Dumpster fire makers can set things ablaze with any tool and the avalanches of trash PHP code are endless. It is what it is.

Post reply on HN