←back to thread

133 points avan1 | 8 comments | | HN request time: 0.022s | source | bottom
Show context
hu3 ◴[] No.45077689[source]
> In short, the modern PHP ecosystem gives us the best of both worlds: the ability to build quickly and confidently in PHP, while still having powerful options (C, Rust, Go) for performance-critical parts. This hybrid approach lets us stay productive without sacrificing speed where it matters most.

I understand this for a large codebase where rewriting is not feasible.

But if that wasn't the case, a C# APIs achieves both speed of development and execution in my experience. You'll rarely need to reach for C++ or Rust.

PHP is great but the language still doesn't allow things like typed arrays. It will happily accept string in a array of dates, for example.

replies(5): >>45077729 #>>45077935 #>>45078609 #>>45079138 #>>45081157 #
ThinkBeat ◴[] No.45077935[source]
Having been in the C# world for a long time, and the various web/api frameworks.

PHP is really nice if you dig into it, it includes so many great functions and functionality built in for creating web stuff.

It also has a number of issues,. but to quikly put something together PHP take the win in my limited opnion.

replies(3): >>45078266 #>>45079032 #>>45081636 #
reactordev ◴[] No.45078266[source]
The only reason PHP still exists is because of shared hosting companies and Wordpress.

PHP’s initial appeal was you could do scripting on the server side, “turn off PHP with a ?>” spit out normal html, and “turn back on PHP with a <?php”.

For a beginner programmer, it was simple, easy to understand, and had an include so your designs were’t nested table hairball messes of garbage. (but your CSS was definitely garbage).

Today, it’s so easy to run JavaScript, I can build a basic jsx site in under an hour, just like I can with PHP and includes. With Bun, I can quickly write a data access layer as well and wire up crud APIs w/ JWT auth. A weekend project in both.

replies(4): >>45078380 #>>45078415 #>>45078417 #>>45085822 #
1. hnlmorg ◴[] No.45078380[source]
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.

replies(3): >>45078611 #>>45079401 #>>45079624 #
2. tialaramex ◴[] No.45078611[source]
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.

replies(2): >>45078828 #>>45079106 #
3. hnlmorg ◴[] No.45078828[source]
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.

4. zelphirkalt ◴[] No.45079106[source]
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.
replies(1): >>45079567 #
5. phplovesong ◴[] No.45079401[source]
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.
6. com2kid ◴[] No.45079567{3}[source]
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!

replies(1): >>45081170 #
7. austhrow743 ◴[] No.45079624[source]
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?
8. hnlmorg ◴[] No.45081170{4}[source]
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.