PHP is worth learning and using
341–350 of 468 posts
Re: PHP is worth learning and using
#342Earlier quoted context omitted.
For people of a certain age and job history, the worst code they've ever inherited was written in PHP. I think JS can be worse. There are things that are possible with dynamic languages that are literally impossible with static ones. So think of PHP less as a "bad language" and more of a code smell.
I don't think any JS code can be worse than old PHP code. I've had to deal with legacy software written with PHP4. I was to port it to PHP7 since it was not compatible with PHP5.4+. The code used "register globals", meaning that variables were created on the fly from the parameters in the URL, the POST form data, and the cookies. Requesting `index.php?something=X` implied `$something = "X";` in the global scope at th…
You'd have to try really hard to make callback labyrinths in JS match the mess that came out of the above combined with runtime-as-template-engine. This was basically idiomatic at the time.
Re: PHP is worth learning and using
#343Re: PHP is worth learning and using
#344Re: PHP is worth learning and using
#345Re: PHP is worth learning and using
#346Earlier quoted context omitted.
I don't find this to be true at all. > you need an external server Spoiler, you need an external server for everything on the web; you've just been brainwashed to think serverless is actually that.
You do not need an _external_ server for a lot of languages. If you use node for example you can use the express package to run a custom server, or embedded tomcat for java
Re: PHP is worth learning and using
#347I'll be honest. I really don't like PHP. However when I was running a coding workshop, very frequently people would ask: "How do I make a web page talk to a database?" I'd say: Well, you know that HTML file? Rename it to become a PHP file and you're almost there! As pretty much all cheap hosting already offers support for PHP (and MySQL for that matter) this would almost always work. I would love to be able to do thi…
[0]: as in, I would have nightmares trying to introduce beginners to full JS stack vs I would have nightmares thinking what they will end up coding when they easily become dangerous with PHP (which is I guess why there are so many bad PHP codebases: it's super easy to start)
Re: PHP is worth learning and using
#348Earlier quoted context omitted.
Sure, a small minority of sites are partially written in python.
Tons of sites are written exclusively in Python. Django alone has 60k stars and 25k forks on Github. That about the same as Laravel.
Re: PHP is worth learning and using
#349Earlier quoted context omitted.
I have seen people deploy php this way but I'm not aware of anyone who'd do it today. Locally however it is save, alt-tab, ctrl-r and immediately you see the result. Absolutely no waiting. These days I rather use Quarkus for this but until Quarkus arrived this was a huge advantage that PHP had over every other language and framework I was aware of. Also the documentation was fantastic compared to most of the stuff I…
I deploy with a git pull Which I suppose is just a fancy way of a copying files to the server.
Re: PHP is worth learning and using
#350PHP needs a proper type system with generic support, and would be a killer programming language