(no title)
dgivney | 11 months ago
Lets break this done.
> global state,
PHP is stateless.
> poor encapsulation,
Encapsulation in PHP is mostly consistent with Java.
> inconsistent APIs,
PHP is written in C and an original design decision by those C programmers was to make the APIs consistent with libc.
> and difficult-to-enforce discipline.
Its very easy to enforce. All modern projects would run tools like Pint, Phpcs & Phpcbf to enforce their code standards and preferred style in their CI Pipeline.
hnlmorg|11 months ago
Old PHP did have some pretty inconsistent naming conventions (or lack of). Which is what I think the GP was referring to.
I’ve not written any PHP in quite a few years but I’ve read that there’s been a concerted effort to address those inconsistencies and the old complaint is now just a relic of a bygone era.
One thing I have learned over the several decades that I’ve been writing software is that literally every language could have a book written about its problems. People often seem to forget that language design is a constant battle of tradeoffs. And because their preferred languages naturally align with their tradeoff preferences, they don’t even realise that their own preferences are deeply flawed for a great many type of scenarios too.
So it really disappoints me when people subscribe to language tribes like it’s their religion.
pmarreck|11 months ago
OK, Elixir's been out for quite a few years now and is used by thousands of people at this point. Find me the "elixir sucks" webpage, which is super easy to find for Go, Python, PHP, Node, Java, and all the rest. And while I'm not a parentheses guy, find the the "Racket Sucks" page while you're at it... The only one I can find, https://www.brinckerhoff.org/blog/2016/04/25/racket-sucks-do..., is a satirical page implying that it will ruin all other languages for you lol. (Hmmm, maybe I should give it another go!)
In short, it is NOT true that all languages are created equal... otherwise everyone would be coding in Assembly, or its close cousin, Brainfuck. ;)