6 ms·
PHP is so much nicer to use on a webserver vs Python or JS. It’s almost like PHP was built for the web and fits it like a tailored suit! Would I use PHP to mak
by archerx 2y ago
PHP is so much nicer to use on a webserver vs Python or JS. It’s almost like PHP was built for the web and fits it like a tailored suit!
Would I use PHP to make games? No! I wouldn’t use JS or Python for that either.
I try to use the best language for the job without letting any cargo cult biases get in the way.
Front end stuff? JS!
Backend stuff? PHP!
AI stuff? Python!
Games and microcontrollers? C/C++!
- wiseowise 2y ago> PHP is so much nicer to use on a webserver vs Python or JS. How?
- diggan 2y agoOne thing that I think is under-appreciated from the perspective of "getting shit done" is that the default model of PHP makes it really hard to have memory leaks that eventually crashes your app/server, as your PHP script has a defined "start" and "end" that are all within the request lifecycle. So even if you leak horribly, thanks to Apache/Nginx/Caddy/whatever only launching your script and then your script stops running, it basically doesn't affect you at all. Granted, this is more like a bandage, but it works out great for beginners who just want to create their own personal dynamic homepages, something PHP does great :) Compared to Python or JS where the standard practice is creating a server that runs constantly, and if you leak memory somewhere, your application eventually crashes as you run out of memory.
- cwillu 2y agoBasically, PHP was using arenas before arenas were cool :)
- archerx 2y agoA lot of the vanilla inbuilt functions are very web oriented and if you like C, it feels very similar but much easier.
- bearjaws 2y agoIs it really that good for backend? 1. You will still need to learn JS, and now it may even be embedded in PHP depending on the type of app you are working with! 2. It still has horrible conventions, arrays being sorted maps has to be one of the worst design decisions, IMO its worse than having null and undefined as types. Mutlibyte strings are still an afterthought in the core of PHP. Inconsistent function naming. It's new typing system is plain worse than TS in every way. Async programming is still terrible. Needle Haystack swapparoos throughout the language. 3. It was built for the web as it stood 20 years ago, HTML embedded in code, single server sessions, cgi servers, and minimal latency server to server communication. It cannot feel more out of place today. I will give it: Laravel is a robust framework that helps hide some of this, but its hard to hide most of it.
- archerx 2y ago1. I am already very good with JavaScript, I like having the language separation between frontend and backend. 2. I much prefer using PHP arrays than JS arrays. All the other stuff you mentioned have never been a issue for me in the past 10 years. I don’t care about types (I don’t even remember when I had a real type bug). 3. The modern web is an over engineered mess, all the modern js frameworks have made the user experience objectively worse. Oh wow your shitty website that has some text and a few pictures is taking 900mbs of ram and 70% of my cpu? Wow very modern! What progress we have made!
- bearjaws 2y ago1) Okay, but in terms of getting shit done how is it helpful to people to learn two languages? 2) They aren't even arrays? How can you say that lol. If you haven't tripped over what I have listed I just cannot imagine how you have been using PHP. I ran into a multibyte encoding issue with Mongodb and Laravel last week for example. Just a few weeks ago the lovely json_encode a map was sometimes an array vs an object. Granted these are older laravel apps... I don't think a framework can fix these issues. 3) Great straw man! I am sure all PHP apps are beautiful things and their interactivity experience with the end user are perfect :) Also speaking of over engineered, how is having to run a standalone web server along with PHP, and then having to have an entire JS stack as well not over engineered?