Ask HN: Which stack is as boring (good boring) and cheap in 2023 as PHP?
- use boring technology - iterate fast - deploy with minimal cost for now
The web frameworks I have used recently (Spring, Rails, Express, Django, Flask, Elixir) coupled with Heroku, or Fly.io, or Kubernetes - they just don't cut it for me. Don't get me wrong: I have used most of the above in production and they fit and perform well, not for an MVP though. The closest I had it to my taste was with serverless (Zappa on AWS Lambda), but it felt like the framework was quite immature by the time.
Some long time ago I have been using PHP. I only have vague memories of copying files over FTP, having my site deployed instantly, and at practically no cost (hey, even with a "shared" DB). Development was fun, but I don't know if I am romanticizing it now, or if the ecosystem was actually making it simple and fast.
So, to your taste, what compares in 2023 to the romanticized experience of PHP in 2000s? Or should I just "undust" my PHP and learn Laravel?
46 comments
[ 3.9 ms ] story [ 101 ms ] threadYou can use a shared database, deployment is easy, the language is pleasant and fast. https://www.swift.org/server/guides/deploying/aws-sam-lambda...
If you don’t like/need React for frontend, you can just use the serverless part (I do it for some API-only projects). The deployment is very easy with Vercel (also possible at other places but I’ve never tried).
But, if you need some advanced backend features (similar to ActiveRecord for instance), maybe you should stick with Rails or Laravel.
Rails is so boring I left it for five years, came back, and almost nothing changed.
go is notoriously boring.
the reagent api for clojurescript hasn’t changed in a decade, though recent things like shadow-cljs do improve qol.
aws releases services with 2 in their name instead of changing existing ones. the old boring service will plod along forever.
aws apigateway v2 is much better, but i have many deployed projects i will never migrate because they are fine on v1.
i do it like this: https://github.com/nathants/aws-gocljs
Definitely not a bad idea. Php has come a long way while composer and laravel has made dev a breeze.
You're absolutely right in picking up a good old boring stack and LAMP still rocks.
Also do explore laravel jetstream / interiajs if you get a chance.
I don’t view AWS as a replacement for PHP-like stacks at all.
GCP, Azure also exist with similar solutions
I don't really see the benefits of putting eggs in multiple baskets. If one basket is down (e.g. images) the site is practically down in many cases. Plus you have to deal with fragmented billing, etc.
To use an analogy, you can use PHP to build the Empire State Building, just not some of the other sexy glass skyscrapers. React is great for things like Twitter and FB which want to feel lively. PHP works perfect for things that are well, "semi-duplex".
Also don't throw away heroku/fly.io/vercel/docker/kubernetes yet, PHP works great on all of those.
Also, Taylor Otwell is incredibly brilliant, and his code reflects it.
I have a boring webhost which is sat behind Cloudflare. I push my code up to Gitlab and have a simple deployment script set up which automatically SSH's into my webhost and pulls down my latest changes.
Laravel allows to me dev locally with ease and makes common tasks like form validation, db migrations and various other things a breeze. When I'm done I merge to main, `git push` and my changes are live. It's great.
If you have some experience with PHP and have been a web developer for some time you'll have no problem picking up Laravel. I've always found the docs to be great and it's very intuitive to work with.
Some years ago I was a PHP dev, but professionally I tend to work with Node, Java and Kotlin these days. I wouldn't use any of them for personal projects though. I find I'm far more productive in Laravel and the ecosystem is mature enough that I know anything I write will be good for years. Plus, deployment is cheap and simple. I pay a fix price (around $100 a year) for my webhost and for that I get "unlimited" domains, storage and DBs. It's a bit slow on it's own, but behind Cloudflare it works great.
PHP is super underrated imo. It's perfect for small - medium sized projects on a budget!
PHP has gotten a lot better over time. For someone who hasn't used it since version 5 or earlier, writing modern PHP with a modern framework like Laravel will probably feel like whole new language. Speed has improved substantially, especially throughout the 7.x releases, and the type system has improved a lot as well.
Laravel itself is a great framework with amazing documentation, and it should be very easy to get started. The one thing I'd warn anyone who's written "old PHP" about is falling into old habits. It's easy to write the same old spaghetti code and jam everything into the controller, but your code will be much more readable if you do some practice projects and intentionally expose yourself to the modern way of doing things. If you've been using other languages in the meantime, this may be an easier transition for you.
Anyone who suggests Go is severely out of touch. It's a great language sure but for a webapp MVP it'll just be a waste of time. I would even doubt any flavor of JS or Python could match what PHP and Rails have done for rapid web development.
I'm not familiar with Laravel but that seems like the natural next thing if you want to use PHP
if you already know PHP:
* PHP with a mature and well documented framework like laravel
if you already know python
* python with django :)
but imho. the deployment of python webapps in general - regardless if you use django/flask/... - is sadly a bit of a pain compared to the ease of PHP...
The Nginx config will look a little different, but it requires roughly the same number of lines in the config file. In both cases a first-time user will probably be doing a Google search for a tutorial and following that tutorial, and in both cases it's pretty much as simple as copy/pasting in the installation commands and then copy/pasting the Nginx config and modifying it to suit your use case.
PHP has the advantage of allowing you to use shared hosting if you really want to, which is great if you're just getting started. Definitely not what I'd want to use for anything resource-intensive, but at least there's a way to build a basic site without setting up the server yourself.
The simplest experience for me would be ASP on .net. It's boring, mature and quick.
But if you know PHP just go with PHP. Laravel is great.
Alone debug support on any Jim based language is so much better.
I would still recommend spring boot with normal pages (templated) so no frontend ja stuff. That should be the easiest and best supported stack.
I would also still do cloud native.
Configuring, upgrading, monitoring etc is so much easier with some cheap k8s behind it (managed by argocd).
Database: managed postgres.
Quarkus with kotlin.
Kotlin makes so much more fun than java, runs on JVM too. Unfortunately it adds a kotlin complexity layer over quarkus which can add issues