Why do most PHP related posts on HN read like repentance ? If you want to promote the language -to the point of buying a ___domain and making a webpage-, please show interesting stuff, not something that is equally trivial to solve in gazillions of web frameworks written in gazillions of languages.
I don’t get that feeling. And I like that people are doing their best to try to improve the reputation of the language. The reality is that modern php is very decent, but a lot of people that have never used it or have used a very old version mock or look down upon it for no apparent reason.
It’s important to try to improve the reputation so that it gets new developers interested in it in order for the language to keep being relevant.
If you want a concrete reason why I think php is great and has many things that are very useful compared to its competition:
Extensive native support for classes and types.
Php does class-based OO better than its competition (JavaScript, python).
Designing a traditional object oriented system using classes and interfaces is better in PHP than in JavaScript and python, if we limit ourselves to the native features of the language.
For example, you cannot define a native interface or an abstract class in python or JavaScript. JavaScript classes, since they’re just syntactic sugar, have a lot of unexpected behavior.
In python you have to accept the this/self object in every method definition.
Here are a couple of links about php classes, interfaces and types for anyone interested:
You just prove my point... you start your post with something that reads like "it's decent now, please look at PHP again". But:
- you make bold claims about PHP OO
- you make downright false points about other languages
- you nitpick things that are non-issues in other languages
All in all, nothing in your post really seals the deal about PHP. It's not about mocking or looking down on PHP for no apparent reason. I'm pretty sure most of us on HN have used it already and most of us have followed its development. I sure did. And every time a new version comes out, I welcome the improvements although it's just mostly catching up with the competition. So what compelling reason do I have to use it again in 2023 for greenfield projects ? None. It used to be "the web specialist", but now all platforms have great web frameworks along their distinctive features.
Because there is a lot of negative propaganda against PHP out there, especially within academia.
You can meet people fresh out of university telling you that PHP is bad even though they have never written a line of PHP. They just know.
This is quite bad for the industry as a whole, because it plays right into large companies that is pushing their technology in an effort to subvert web.
I wouldn't say it sucks, or rather at this point it has its warts like any other platform. It's definitely not a pretty thing, and it was never meant to be. It's something that borrows from the competition rather than innovate.