Because (1) both very often used in webdev, (2) both have many "adherents" that totally love the language yet have little exposure to languages of different paradigms, (3) are (opinion alert) not very well designed.
I'm aware of the differences between JS and PHP.
If you, like me and many others, shrugged them both of for years and came back to them pleasantly surprised, it might change the timbre when reading that.
I'm not sure I agree that it's the best but it's got some things going for it:
- incredibly fast to deploy and iterate
- supported in some fashion on more hosting solutions than other languages or compiled binaries
- one of the best performing interpreted languages
Not all of these benefits apply to me so I don't use PHP but under the right circumstances I'd look at it again.
Counter examples:
https://www.reddit.com/r/lolphp/ (this language is soooo weird there is a community documenting its weirdness)
https://www.destroyallsoftware.com/talks/wat (lovely talk about JS's weirdness)
I dont like the fundamental weirdness of these langs. I like predicatble langs. Unpredictable langs will never be "completely ok languages" to me.
PHP was quite fairly maligned for a long time. The issue was never "weirdness" but rather poor design. Starting with final 5.x they started turning it around and deprecating or fixing a lot of the worst bits.
JavaScript was a joke but modern js is tight, clean and generally very fast.
To me all weirdness IS poor design.
> JavaScript was a joke but modern js is tight, clean and generally very fast.
Fast it sure is, for an interpreted language.
On "clean and tight" I beg to differ. I find it an unholy mess: the language, the stdlib and the ecosystem.
Weirdness is subjective. If you look at lisp for the first time coming from other languages it will be weird.
PHP had glaring issues for years, but they started to clean up the language around 7.x.
JavaScript was effectively a toy but grew up in a hurry when Node pushed ecmascript forward and into a well paced release pattern.
JS isn't per se. You can use it for OOP, but it's only a subset of what you can do with it (I'd argue there is enough traps that it's better used with other paradigms than OOP). I also don't see ES6 as very related to C syntax anymore.
To your point, PHP and JS could be close in spirit, pushing forward the good parts while letting the bad parts rot on the side, and heavily relying on programmers' discipline to build clean code. Good PHP devs tend to be good JS devs as well.