3 ms·
Why do you treat PHP and JS as similar languages? They're worlds apart, have different purposes and have almost nothing in common.
by mmcnl 5y ago
Why do you treat PHP and JS as similar languages? They're worlds apart, have different purposes and have almost nothing in common.
- cies 5y ago> Why do you treat PHP and JS as similar languages? They're worlds apart, have different purposes and have almost nothing in common. 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.
- nkozyra 5y agoA fairly useful addendum to your list might be 4) both have grown up into completely ok languages. 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.
- cies 5y ago> 4) both have grown up into completely ok languages. Counter examples: https://www.reddit.com/r/lolphp/ https://www.reddit.com/r/lolphp/ (this language is soooo weird there is a community documenting its weirdness) https://www.destroyallsoftware.com/talks/wat 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.
- nkozyra 5y agoFind me a language without a few of those classic 'wat' quirks. They almost all have them. 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.
- cies 5y ago> The issue was never "weirdness" but rather poor design. 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.
- nkozyra 5y ago> To me all weirdness IS poor design. 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.
- ajxs 5y agoThey have so much in common. They're far more similar than they are different. Both are procedural, object-oriented, loosely-typed. Their syntaxes are both loosely-derived from C. The similarities go on.
- makeitdouble 5y ago> object-oriented 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.