Skip Navigation
39 comments
  • Finally someone who know how to do things properly.

    Modern PHP isn’t half bad, and it has at least two major benefit over some of its competitors: Each request is a totally independent request that rebuilds the world. There’s no shared state (unless you want there to be).

    big benefit is that you’re not stuck with having to learn and maintain a huge bells-and-whistles 3rd-party framework in perpetuity. I think people really underestimate the burden of maintaining a 3rd-party framework even after development of the website is complete

    Starting on a cloud provider cedes one’s independence because it often leads to vendor lock-in.

    The big benefit of running a basic Linux box on our own VPS is that everything is just files on a generic, well-understood platform (...) a VPS is a low-cost, simple, and lock-in-free way to go. Very classic-web.

    At the end of the day...

    All of this goes to show that you don’t need a whole lot to build a performant, useful website, capable of serving millions of requests a month, on a tiny server that also handles other resource-intensive tasks.

    • Modern PHP isn’t half bad, and it has at least two major benefit over some of its competitors: Each request is a totally independent request that rebuilds the world. There’s no shared state (unless you want there to be).

      ...isn't that how every web framework works?

      • Anything JS / NodeJS doesn't work like that and that's precisely one of the issues with it. Node will also keep running a process in the background even if the website/app isn't ever accessed wherever PHP won't be running anything until a request comes.

    • Each request is a totally independent request that rebuilds the world. There’s no shared state (unless you want there to be).

      I with there was a language with this model, but without the language itself being completely garbage.

      • Isn't that the same as modern languages? For example in ASPCore / C#, you can just register all your services with a lifetime scoped to the request, and then there's no shared state.

        If you want there to be a shared state, you'd just have to register your services with a higher lifetime scope, like with a singleton scope

      • You can still use CGI with Apache. Apache will execute your program on each request and return its output from stdout as webserver response. If you have a form, it'll get POSTed to stdin when Apache execute your program. You can write your program with whatever language you want as long as you can read stdin and write to stdout. It's just tedious af so no one really use it these days. PHP was basically born because people got tired writing CGI program with pearl or C and want something more convenient. But with modern programming languages, perhaps CGI is not too bad, except the one process per request which will absolutely kill your server the moment you have visitors spike.

      • And there is... its called PHP. JS doesn't have this model because it is complete garbage slow and wouldn't ever run fine and reasonable in that model.

39 comments