misterjesus on Nostr: PHP, IMO has some advantages over JavaScript (and a lot of the other more popular ...
PHP, IMO has some advantages over JavaScript (and a lot of the other more popular languages).
The benefit that PHP has is that it is pretty simple to deploy. Copy it into a folder usually and maybe a few lines of config in Apache / Nginx, and you are up and running.
Most modern JS/TS usually needs npm. I am pretty decent with build systems and NPM, and I hate dealing with it. You don't need any of that with PHP. Even if you use composer (the npm equivalent), it is a lot more sensible.
Dealing with Requests/Responses is super straightforward.
IIRC it has things like type hints now. You have a decent-ish OOP system. First-class functions etc.
Also, the language/runtime has improved a lot in the last 10 years.
People write it off. But PHP isn't a bad choice in some circumstances.
The benefit that PHP has is that it is pretty simple to deploy. Copy it into a folder usually and maybe a few lines of config in Apache / Nginx, and you are up and running.
Most modern JS/TS usually needs npm. I am pretty decent with build systems and NPM, and I hate dealing with it. You don't need any of that with PHP. Even if you use composer (the npm equivalent), it is a lot more sensible.
Dealing with Requests/Responses is super straightforward.
IIRC it has things like type hints now. You have a decent-ish OOP system. First-class functions etc.
Also, the language/runtime has improved a lot in the last 10 years.
People write it off. But PHP isn't a bad choice in some circumstances.