It really hits a pragmatic sweetspot. It's really easy to deploy and frameworks like symfony give you all the power like rails but without the magic.
It really hits a pragmatic sweetspot. It's really easy to deploy and frameworks like symfony give you all the power like rails but without the magic.
Node has the advantage of same language back and front, "asynchronous" execution and having both dynamic typing and static typing with TypeScript. And huge ecosystem obviously helps as well.
Python also has pretty sizeable community and Django is probably a huge reason why a lot of people choose python over anything else. And the syntax, at least to me, feels much less cumbersome than PHP. But I have not tried PHP 8 at all.
Only downside is that there does seem to be quite a lot of (non-trivial) deprecations which is understandable but I wonder how long it'll take for 8 to percolate into production...
The cases that are not replacable easily are things that should never have been written ever.
But I never found back to PHP after switching to JavaScript in 2011. If something new comes out it usually runs JS.
On the other hand, most systems I worked with were async, so they fit really well into the JS model of programming.
I started off with PHP3 and have a very great and hated time with it till v5. PHP for sure is difficult to maintain and very painful to debug, but it's not my reason leaving it. It's because JS began to pick up and started to do many tasks that requires no server rendering. The server sides started to become just API server, which no longer generate html on the fly. It's much scalable and easy to maintain.
Time flies, now I see the release of PHP 8 and I realise I have ditched it for a decade. Do I miss you? No.
TBH, I'm still not aware of any truly simple/easy way to get a dynamic HTML page.
Recently, I had to make a dumb utility app to render some dynamic data, and I wound up writing a Golang server with the HTML specified as a Go Template. But making it accessible on the publc internet still required spinning up a server, installing nginx, configuring SSL with Let's Encrypt (at least it was free) and futzing around with nginx `proxypass` directives for several hours.
It works, and I guess it's conceptually simple, but it was still an all-day ordeal to get it up and running from scratch.
https://azure.microsoft.com/en-us/services/app-service/stati...
Not a dynamic HTML page per-se but a page with dynamic data.
I deployed one of my old hackathon apps with it, works well - https://memorylane.benbristow.co.uk/
Write a systemd unit file for your golang service, put Caddy in front of it and you are good to go. It's not a PaaS, but it's simple and shouldn't be too difficult to maintain.
Oh yeah, I forgot I had to do that, too! Another step.
I'll take a look at Caddy!
It has even come in handy at work. I'm primarily a front-ender, but a start up I worked for had me continuously deploy my application to my own personal infra so it could be used immediately.
It is an ordeal at first, but nginx is so darn powerful it makes me feel like a wizard. If you want to avoid the arcane incantations, I'm sure Caddy would be a simpler option.
If you don’t want to just use some shared hosting, grab any server and use the package manager to install Apache + PHP.
Drop HTML in the web root.
Whatever part of the page is supposed to be dynamic, you can literally just start throwing code in the middle of the HTML, mixing it all together freely.
It won’t be beautiful, but you can go from nothing to this in like 30 minutes or an hour.
So if in rails you declare an active record model with belongs_to etc it's hard to keep track of what is really happening under the hood.
In php you have almost no runtime metaprogramming so the things that could happen if you read a piece of code are reduced to a smaller set of options that are easier to understand. well you have reflections but at least they are used in a more static way.
I would prefer to review a messy 50kloc php project over a messy 50kloc ruby project.