@robertobutti
https://dev.to/robertobutti/why-php-2e4h
Read this article; here are some thoughts on the subject.
PHP will never ever be on par with python because these three reasons:
No native SET data structure support, which is a direct proof that php never was designed for data programming. Amazing @krakjoe and friends introduced it only in 2016 in Ds pecl extension, while python have had it from start.
Consider algorithmic problems such as leetcode stuff, php developer would struggle in half of them not thinking data first - with set structure being a solution in half of this half. Famous expression - framework is not the way you code, it is the way you think. Same situation here. Programming language is not the way you code - but how you think as a programmer, what is your approach, etc.No native coroutine/async/await support in php. Same situation, only adopting ReactPHP/Swoole would give you this instrument, although you’ll have to struggle implementing async solutions for common jobs like databases, etc. And core php team never thought of that in the first place, why?
To create python’s FastAPI stuff you’ll have first to invent it with only Swoole being native implementation of the approach, still it is an external library.Multithreading? Forget it. No native support as well. First thing I had to do as a math student 30 years ago was to implement rectangles method multithreadingly. Guess what, you can’t do it in php.
Funny story is that I never hesitated which language to choose, PHP was there for me right away :)
And I am not trying to start a hate topic. I only think that one should be realistic and aware about cans and cannots with this or that instrument.
K! THX! BYE!
Top comments (5)
A programming languages is just a tool to solve problems just like 20% or less of the cases would need something PHP or its ecosystem doesn't have.
And there's the answer PHP delivers, users care about results PHP is a fast and convenient way of doing web programming
PHP framework that handles multithreading, coroutines, uses data structures: resonance.distantmagic.com/
What is the issue with plugins?
Thank you for this gem that your framework is. Any non-chinese person who figured out how swoole works deserves a salary raise :) because lack of docs etc…
And there are of course no problem with extensions, but you have to be aware of their existence, at least. While the very presence of a language keyword ‘await’ is telling you that a language has this mechanism.
I think php docs should put the most important extensions at the beginning.
Thank you so much, I really appreciate it :)