News for hackers. Stuff that matters.
Re:I still love PHP and JavaScript by soheil on Tuesday August 02, 2022 @08:17PM (#32326073)
> EDIT: why the downvotes?

The anti-PHP cult is strong here on HN. List 5 benefits of React and watch your upvotes skyrocket.

Re:I still love PHP and JavaScript by snapetom on Tuesday August 02, 2022 @11:01PM (#32327155)
It's more like redditors creeping in. The "downvote is not a disagree button" of reddiquette went out the window a looong time ago. People are fast to hit that button and the attitude is seeping in here, harming discourse.
Re:I still love PHP and JavaScript by zeroonetwothree on Tuesday August 02, 2022 @10:14PM (#32326853)
It's cool to hate on popular things.

https://headstuff.org/topical/love-hate-popular/

Re:I still love PHP and JavaScript by throwaway_4ever on Tuesday August 02, 2022 @09:07PM (#32326445)
React gets an equivalent amount of disdain as PHP. Like 60% negative, 40% positive. (lots of preferences for server-side templating, htmx, Vue, Svelte, and Phoenix LiveView)
Re:I still love PHP and JavaScript by fsdghrth3 on Wednesday August 03, 2022 @02:22AM (#32328274)
React is great. Vue is wannabe angular (not sure what version though was it 2, 3 or 4 now?) svelte is too busy shipping bugs to fix any and I don't even know what the others are.
Re:I still love PHP and JavaScript by ronsor on Tuesday August 02, 2022 @09:10PM (#32326459)
I agree with you on the anti-PHP cult, but it's become fairly "cool" to criticize React now (and JavaScript stuff in general).
Re:I still love PHP and JavaScript by mekster on Tuesday August 02, 2022 @10:32PM (#32326968)
Criticizing is so easy, especially on the internet. If they're that good, why won't they propose a workaround or work with the language developer and provide some feedback?
Re:I still love PHP and JavaScript by mekster on Tuesday August 02, 2022 @10:29PM (#32326952)
Elitists can't like what the general mass likes. There's a reason the general mass likes but they think they can do better, but let's see how they do so in real life.
Re:I still love PHP and JavaScript by sidlls on Tuesday August 02, 2022 @08:21PM (#32326120)
What cult? PHP is technically, objectively inferior to almost every other web technology (which is impressive, actually, given how terrible most web technology actually is) in almost every use case one can think of. That doesn't mean it's bad or that nobody should ever use it, or that it isn't a superior solution in some cases. But in basically any non-trivial use case, it's a poor choice.
Re:I still love PHP and JavaScript by larve on Tuesday August 02, 2022 @08:44PM (#32326294)
Thanks for commenting!

I always have a hard time understanding what exactly is meant with comments like these. We can all agree that PHP has a wildly uneven standard library, had its fair share of security-relevant footguns, tends to have unexperienced developers. That's not extremely different from python and node.js, for example.

The language significantly cleaned up its act, it has had classes, traits, closures, introspection, namespaces, packages for well over 10 years now, a robust third party library ecosystem and many successful projects to build upon (wordpress, drupal, woocommerce, phpbb, etc...). This makes it a pretty good choice for many applications.

The stateless model and the resulting "no crazy stuff" approach makes it a much more reasonable choice for web development than say, python+django or ruby+rails to me. There's nothing I loathe more than trying to find which duck-typing, method-injecting package is causing a slow-burn memory leak in production.

I also don't understand where the "most web technology is terrible" stance comes from. I find the quality of software engineering and the care put into developer UX and productivity in the web world quite inspiring. It has been a forcing function on all programmer tooling since the cambrian explosion in the earlier 2010s.

Re:I still love PHP and JavaScript by hattmall on Tuesday August 02, 2022 @08:30PM (#32326177)
That's not really true at all. PHP is like a Swiss army knife. It's not the very best at any one speciality. It is much better at many things than pretty much anything else though. You can use the Swiss army knife to put in screws, but a screwdriver is much better, but it's terrible at cutting zip ties.
Re:I still love PHP and JavaScript by akudha on Tuesday August 02, 2022 @10:09PM (#32326824)
Suppose you had a old car. You know its limitations, you've used it for many, many years. You know its problems, its quirks and warts. You also know the workarounds for its quirks. In all, it is good enough for most of your needs. It rarely surprises you. It is average looking, but it just runs and is easier to maintain.

Then comes the shiny new car - it has way too many gadgets and gizmos, you don't know how most of them work. Heck, you don't even know what half these gadgets are for. You don't know when or how it will break. But most importantly, you don't know how to fix something when it breaks, because there is too much magic going on. High maintenance, constant stress.

The first case is PHP. People can dunk on it all day, every day. But it is good enough for most projects. And with tools like Laravel, Composer etc, PHP is constantly improving too.

The latter? I dunno, there are lots of candidates for it I suppose.

Re:I still love PHP and JavaScript by lmm on Tuesday August 02, 2022 @11:36PM (#32327372)
PHP has never been simple or understandable though.