Remix.run Logo
hnlmorg 2 days ago

PHP might have a bad reputation but I honestly don’t think JavaScript is a better language in real world terms.

I do get why JS appeals to people, but switching from PHP to JS feels a little winning an internet argument — you might feel smarter for doing so but in reality all you’ve done is sunk time into something that doesn’t make you any better off.

tialaramex 2 days ago | parent | next [-]

There's a firm foundation in Javascript. The choices aren't choices I'd make but they're choices I understand. Brendan Eich knew what he was doing and it shows, indeed if it was made simply of bailing wire and string it'd have been replaced.

For PHP on the other hand - even when I started writing PHP3 - so certainly not the very beginnings, it's clearly just cobbling together whatever works from unrelated half-understood parts and so there's no coherent centre to it, when I last worked on some PHP earlier this year it still felt like bailing wire and string.

hnlmorg 2 days ago | parent | next [-]

The JavaScript invented by Eich is nothing like the clusterfuck that is the modern JavaScript ecosystem. And modern node.js code will look nothing like the JavaScript Eich developed for Mozilla.

Equally, PHP3 is worlds apart from modern PHP.

Your point is a little like saying “motorbikes are easy to maintain because they’re based on the penny-farthing”. Times have changed and your references are literally decades out-of-date.

zelphirkalt 2 days ago | parent | prev [-]

Do we need to post that JS' weird things link here? Of the basics of JS, few things are sound. The "firm foundation" idea doesn't really work for JS. It might even work better for PHP, and I am saying that as someone, who doesn't want to do PHP ever again.

com2kid 2 days ago | parent [-]

JS is very much a minimal language that has a handful of choices. E.g. arrays being objects with field names that are sequentially numbered integers.

The initial equality operator was a mistake, but that was rectified over a decade ago with `===`. Not having a proper int type sucks and holds the language back in a number of ways, but otherwise the language is wonderfully regular.

And anyone who complains about the ecosystem has obviously never tried python, which after a decade of attempts, is now almost on par with JS of a decade ago!

hnlmorg 2 days ago | parent [-]

You shouldn’t compare backwards.

Saying “at least x isn’t as bad as y” doesn’t further a discussion, it only acknowledges denial about just how bad the problems are with x.

This is particularly true when we weren’t even discussing y (in our case, Python) in the first place.

austhrow743 2 days ago | parent | prev | next [-]

What if the context isn't that you're switching from PHP though? What if the choice is to stick with Javascript for the full stack, or to also learn PHP on top of Javascript?

phplovesong 2 days ago | parent | prev [-]

JS is basically just a comp target as of 2025. If PHP devs used something like Haxe they would be amazed how safe their programs would be. But i usually just see slop instead.