HACKER Q&A
📣 poletopole

Any open problems in PHP that need solving?


I’ve have a decade of PHP development under my belt and have been reflecting on why PHP, despite recent improvements to language, is still problematic. One side of me says that the community should just let PHP be “PHP”; if a Typescript for PHP were made, would the community embrace it or lament it? The other side of me says that it’s not PHP, the language, that is problematic, it’s simply _how_ it is used; for example, PHP frameworks—although useful and serve a purpose—don’t really result in less debugging time nor do they make code more literate or smaller in scope.

So the question I pose is: A. Should PHP as a language be augmented, like TS does for JS, or B. Should the community focus on the methodology of PHP to make development simpler? What are some concrete propositions you can imagine that argue for either case?

I think any PHP developer can propose more than one new feature they would like to see. As for A, I personally would like to see an actual native module system. As for B, I would like to see less MVC frameworks and more macro systems within the ecosystem.


  👤 ameyv Accepted Answer ✓
I used to write php apps and wordpress plugins. Php always felt messy and weird to me. But i think strength of php lies in its vast available free scripts and ability quickly stitch up server side rendering, but probably now, node would be better for that now.

it feels like certain style which was popular a decade ago, now seems not so exciting or new. Probably that vibe is what lost with php.

But then if you like to find try out other language like Kotlin, Haskell, Elixir or even Ruby.

I think there are other language communities are much more vibrant than php. For example python, ruby, java. Also these language have expanded their beyond just web development that also kind of fueled that adoption.


👤 02020202
no. php is perfect as it is and always was. php got bad name because it was the first language most programmers started with..before javascript became the language of the web browser. so with larger user base you will get more bad programmers, hence the language will get bashed more. since php is not stirngly typed you can end up with really bacode, but it will work so the bad programmer syndrome is constantly fueled by bad code written by bad programmers :D .... to this day it is the most used and most performant interpreted languge and it is still de facto the languge of the web. in other words, php became a victim of its own success. remember before type script how people hated javascript, and still do to this day? well, php is not typed language so amateurs that cannot write a good code if their life would depend on it and the ivory tower armchair java/c#/.. warriors will be always bashing it. but php itself is great. absolutely nothing wrong with it. if you don't like it, don't use it. the language is not the problem, the people are, as usual. there is plenty of alternatives so instead of complaining, people should just stfu and move on.

personally i have moved to GO some years ago after over a decade with php. not because i had enough of it. no, i love php. but there is no money in web development anymore. so i moved to a compiled languge and do purely backend and less web/front oriented stuff, which i always preferred anyway.

though before i left php i remember that i was getting interested in parallel computing and Go had goriutines which served me well. php was getting the reactphp, swoole and other projects at that time but i decided to change the direction so even if it would work for me at that time, now i do more lower level stuff that php would not be suitable for anymore anyway.


👤 skinner927
What problems does PHP as a language solve better than other languages?

👤 wolco
a) no

b) yes

I'm pretty happy with what php has become. Don't really understand the typescript benefit here.

I would like to see a popular async framework.