4 ms·
HN white knights JavaScript but hates PHP. I can't figure it out. Each language is horrible in similar ways.
by Miyamoto 13y ago
HN white knights JavaScript but hates PHP. I can't figure it out. Each language is horrible in similar ways.
- dasil003 13y agoThe similar horrible things are the superficial warts related to dynamic typing and heavy usage by amateurs leading to poor code quality in the wild. However there's a big difference which is that Javascript has always had first-class functions, lexical scope, and object-oriented via prototypal inheritance. PHP attempted to bolt on some approximation of all of these over the years, but the result is a sort of Frankenstein shambler. Javascript for all its problems at least was designed with a reasonably powerful core. That said, HN has plenty of terrible things to say about JS, so I think you're exaggerating a bit.
- greenlakejake 13y agoI've used both. Each of these languages has its quirks. But JS's design makes PHP's design look like it was done with crayons.
- frozenport 13y agoI will never forgive JS for the `this` pointer.
- greenlakejake 13y agoI will never forgive PHP for all kinds of shit.
- antiglacier 13y agoCare to expand on that a bit (without repeating items found in the "Fractal of Bad Design" article)?
- TazeTSchnitzel 13y agoNot really. JS has some design flaws, but if you look past them it is a really solid language. On the other hand, PHP started with design flaws, then accumulated different design flaws from all paradigms, so it is now a frankenstein of design flaws.
- SPSteinbeck 13y agoNo.