July 22nd, 2024

Web Crap Has Taken Control

The article critiques React's dominance in web development, citing complexity, performance issues, and excessive dependencies. It questions industry reliance on React, package management challenges, and suggests reevaluating development tools for efficiency.

Read original articleLink Icon
Web Crap Has Taken Control

The article discusses the challenges and inefficiencies in modern web development, particularly focusing on the dominance of React in the frontend ecosystem. It criticizes the complexity and performance issues introduced by React, highlighting the need for asynchronous programming, excessive dependencies on third-party packages, and the bloating of codebases. The author argues that the industry's reliance on frameworks like React has led to convoluted code, decreased performance, and unnecessary complications in web development. The article also mentions the irony of companies adopting React to emulate Facebook's success, despite Facebook itself moving away from React. Additionally, it touches on the issues of package management, version control, and the impact of these practices on application performance and developer workflows. Overall, the article questions the direction of modern web development and suggests a reevaluation of the tools and practices being employed to create more efficient and user-friendly web applications.

Link Icon 28 comments
By @mattlondon - 4 months
React (and NPM for that matter) is not all web development, in the same way that Windows is not the only OS.

Vanilla JavaScript these days is an absolute joy to code in (and highly performant compared to the past). Even lazy-loading modules are supported natively by the browser these days - you can go a long way just using purely built-in default functionality.

I avoid NPM and React, and live my professional life quite happily without them doing professional development using typescript and angular with bazel. For fun home projects there is deno which is also lovely. Bun looks interesting but appears to want to ape NPM so it is a no from me.

By @deepsummer - 4 months
I am not sure the author really knows what they're talking about when comparing today's web development with earlier systems.

First of all, the reason for useEffect() is not directly asynchronicity. It's mostly an optimization to give React control over what code it needs to run when the state changes. This is because with React, you basically re-render a document with every state change, and in order to speed this up, React needs to know what code depends on what part of the state. Admittedly not pretty, but all of the more automated MVC-like systems have mechanisms to detect or handle model changes.

They are completely wrong about asynchronicity. Since the 80s GUIs have been using event loops. Windows 3.x did this, and even really old UIs like GEM did. When using an event loop, you must execute operations asynchronously or the event loop will block. That's not new at all. What's new is that, these days, applications are interacting a lot with the network, and these are blocking operations. They require asynchronicity in an event loop. This wasn't really the case back in the days before the internet, when everything was local. And for longer computations you had to call functions like yield() to give time to the UI.

He mentions threads, but they didn't really became a thing before the early 2000s. And threads never worked very well with most UIs (except the good old BeOS?).

It's easy to complain about issues with today's development frameworks and easy to overlook the limitations in the past. UI development was always a pain, especially for applications that are larger than the typical demo app. I have worked on apps using GEM, MFC, QT, GTK, TCL/TK, AWT, Swing, JavaFX... it doesn't matter. It always sucks one way or the other.

Today's web-based UIs and their dev tools are a marvel in many ways. Like you can easily update them without going from computer to computer, or let user run install programs. They easily adapt to all kinds of screen resolutions and screen orientations. You can easily debug them in the browser, even on an enduser's computer. You have package managers that make it easy to add and later update libraries. Certainly not everything is perfect, I still kind of hate UI development, but it's a huge improvement over everything we had in the past.

By @CharlieDigital - 4 months
While I agree with the author on many fronts[0],

    > For example, Blazor framework, which uses WebAssembly to run C# code directly in the browser [17]. No bizarre syntax, no winding code flow, no infrastructure madness and, especially, no bad performance.
This is simply not true. Performance here is objectively bad since the payload is quite large. Also, I would comment that the DX with Blazor is not very good overall. For all the things broken with JS UI dev these days, DX with hot module reload is quite a marvel that I wish more platforms could achieve (C# kinda has it).

My team recently did a large browser extension project and ended up using jQuery and web components. One of the younger devs made a humorous comment like "Why does this feel kinda nice?" (paraphrase). We've somehow been convinced that direct DOM manipulation is a no-no when in fact, it's performant and the DOM itself can represent the state without the need for complicated solutions like VDOM diffing. (I don't know about other teams, but even if I plan to use React, Vue, or other front-end libraries, I'd interview candidates on raw HTML+JS+CSS first.)

But yes, overall, the pain is very real. A recent pass with npkll[1] freed 20+ GB of disk space....

[0] https://chrlschn.dev/blog/2023/02/react-is-the-new-ibm/

[1] https://npkill.js.org/

By @1GZ0 - 4 months
If all you have is React, everything looks like a SPA.

I honestly think the real problem is that we have a whole generation of web devs that really only know react.

By @throwawayffffas - 4 months
Html, css, js and react are the worst solutions for graphical user interfaces, except for all the others thought (The only exception is perhaps immediate mode guis).

React is bloated, slow and over-complicated now days, but unfortunately the only sane way to work with retained mode UIs.

In my experience working without react devolves to reimplementing react ad hoc.

By @golergka - 4 months
I think the author misses one of the main advantages of react: transformation of application state into ui is a pure function. I've worked with a lot of different UI frameworks (mostly in gamedev) before switching to web development, and I've ran into a million issues that occurred because of procedural approach to UI.
By @llmblockchain - 4 months
Nowadays it's common for developers to learn React before they even learn JavaScript, and that's not great but it's not the cause of the problem.

It's the companies that pile on to a stack because it's "easy to hire for". If everyone optimizes for hiring we end up with a local maximum, React. We can't do better because no one else is doing better.

By @frizlab - 4 months
Ironic, writing this on medium of all platforms…
By @popcalc - 4 months
Dotnet MVC is a breath of fresh air from working on React projects. Going from Prisma to EF Core feels like I'm time traveling back from an Idiocracy (2006) world.
By @graypegg - 4 months
I think with these sorts of rant-like articles, my expectation is the author will tear down the strongest possible contra-arguments. I don't think this author is doing that. Quoting random numbers as "too big" and random examples of web apps as "too slow" really doesn't feel like more than an angry rant. Which is fine! But it's just not something I'm going to praise you for, even if I agree with some of the core points I think you're trying to make.

It would be nice to see examples of React applications commonly considered "the good ones", and showing us that they are actively subverting some element of React's framework to accomplish that feat, or how they could be better implemented with another framework/technology/platform. Show React actively standing in the way, versus ranting about how one of the most common JS frameworks, is commonly used to create sub-par applications on a platform renowned for it's size and accessibility to amateurs.

By @whywhywhywhy - 4 months
Although I don't agree with all of the points I have to say the amount of times a year I'm told with a straight face the following for lists with under 200 items in them is getting ridiculous.

> The truth is that it’s simply unacceptable that in 2024 people are still trying to convince us that something as simple as a list could be slow in any reasonable scenario

By @bob1029 - 4 months
I stopped worrying about cargo cult web development once I recognized that these frameworks ultimately use the same vanilla APIs and do not represent a fundamentally different path that is in conflict with anything I care about.

Somewhere in that dark JS ecosystem forest exists an actual call to document.getElementById(). The browser is going to execute it in the exact same way it would be executed from my vanilla code. There is no magic here.

So, for me the stakes are more about my experience of browsing the web getting crappier over time. Not sure how avoidable this is considering how much the web has grown in scale & accessibility. Hackernews is still a good experience (IMO), so you can't say it's all gone to hell. I don't care that others use these tools anymore. I used to need frameworks to get things done before I mastered the fundamentals.

By @cpursley - 4 months
I’m always amused that the solution proposed to the JS framework dumpsterfire is always another JS framework dumpsterfire. Instead of something sane like good ole MVC Rails or even cutting edge like Phoenix LiveView.

Like, hello, earth to HackerNewsers - the problem is JavaScript itself - not the frameworks.

By @hilbert42 - 4 months
"Finally, stack on top of that all this garbage code introduced by JavaScript frameworks. The magnitude of inefficiency is just insane."

Right, and it's why I turn JavaScript off by default. Pages filled with this crap are so slow I reckon I've not enough time left in my life to wait for them to load. If a site's webpages are overly large and bloated it's an indication I shouldn't be there and I'm out and away quick smart.

Moreover, as a general rule, I've found the more boated a site is the less value it has—as so much of the bloat revolves around advertising and stealing one's info. With such pages the more spent on JS junk the less is spent on its valuable content.

By @culebron21 - 4 months
Just like that former frontend dev in 2016 who switched to backend, I did the same exact that year, after meeting with React & Angular. ...Although, the rationale for React (hashing and re-rendering data tree only partially) seemed very compelling.

I also remember the 2009 Crockford's lectures on Javascript where he insisted that JS was getting faster with JIT, and all the devs needed to do was to make functions return quickly and postpone the rest of the work to the async event loop.

Turned out, that expectation of high performance from JS was just an optimistic extrapolation of Google Chrome's JS optimizations. They happened in 2007-08 and probably ended in 2009 when the lectures were given.

By @surfingdino - 4 months
It could have been different, we could have gone down the Curl path https://en.wikipedia.org/wiki/Curl_(programming_language)
By @incrudible - 4 months
The person writing this must have little to no experience developing UIs in classic frameworks. React has warts, but it is a decent implementation of reactive UI, given the constraints of the web platform. Of course you can achieve a speedup doing better what React does with less context - updating only the exact parts of the DOM that need updating. You will pay the price in terms of code complexity.

As for asynchronous behavior, this is not something you can avoid. You can not block on network requests, or block until the user clicked somewhere. React does not push you towards async any more than the platform does.

By @jonwinstanley - 4 months
There’s definitely a case for rewriting React apps in much more simpler “old fashioned” backend technologies these days.

Devices and network speeds are so much faster and tech like HTTP/2 and nginx can take it up another notch.

And as the article points out, React and rest of JS ecosystem is so much more complex than using Rails or Laravel.

By @ecocentrik - 4 months
All platforms and ecosystems that reach critical popularity are eventually overdeveloped and under optimized. I'm a little surprised that npm hasn't been replaced yet but I'm not surprised that React is still a thing.
By @egeozcan - 4 months
React has its flaws, and there are many articles pointing out its obvious issues today.

Personally, I love Web Components and Lit, but they come with a complexity that can be challenging for juniors to grasp. Making shadow DOM accessible, managing CSS, using the :slotted selector, and handling CSS variables across boundaries are just a few examples of the intricacies involved. This is only scratching the surface for one of the simpler frameworks. You need to manage a lot because it's relatively new and lacks some tooling. Solid is excellent, but its differences from React (while being so similar) can confuse people. If you want to use HTMX, you need to learn something entirely different and understand server-side templating, which becomes even more complicated if different teams in your company use different back-end technologies. Architecture follows the org. structure, so as long as front-end and UX-design stay closer to each other than the back-end, it would also be hard for HTMX to come into play.

So why React? Isn't it more complex? Yes, but it has outstanding tooling, documentation, support, and a vast ecosystem. Almost everyone knows React, even if they don't like it! Despite my personal dislike, it's one of my go-to frameworks for new projects because of these reasons.

While there are performance issues, there are many experienced developers who can address them. There are also a lot of very smart people working on various solutions.

In summary, you can argue for any framework, but please don't believe that nobody knows what they're doing. It's important to take a pragmatic approach. Also, no, front-end developers were not thinking that React were rendering on the server all this time and they also didn't think that static HTML would be slower or anything. Please don't spread false stereotypes.

That said, I believe we'll see a new approach, framework, or technology that will surpass React in the near future. While I appreciate the pragmatic, organic growth and improvement, many feel that a restart is becoming necessary.

By @efilife - 4 months
Posted on medium, how ironic
By @missedthemark - 4 months
Angry man yelling at cloud (haha) article preaching to the choir. Not sure why I read it to the end, but at least I go to read the absolute gem of:

> However, if the web application is intrinsically complex, JavaScript is just not suitable, period. In this case, it’s recommended to use a proper programming language instead. For example, Blazor framework, which uses WebAssembly to run C# code directly in the browser [17]. No bizarre syntax, no winding code flow, no infrastructure madness and, especially, no bad performance.

Because running .NET on WASM is so much less insane than running JavaScript. Maybe in 30 years when WASM can do things without JS shims will that be a less ridiculous take.

By @mouzogu - 4 months
> "Start with the absolute simplest ecosystem possible"

has to be the most javascripty advice ever lol. instead of "solution", uses "ecosystem". lmao.

the problem with web is and always has been that there is a million ways to do the same thing. each one has it's own trade off, and you might not discover that until you're far too deep into the muck.

By @kissiel - 4 months
Post about web crap that, when opened, is covered in 75% by crap :D (privacy policy, google login, medium subscription)
By @knallfrosch - 4 months
Just another rant about the supposed bloat in modern web development.

> There exists in such a case a certain institution or law; let us say, for the sake of simplicity, a fence or gate erected across a road. The more modern type of reformer goes gaily up to it and says, “I don’t see the use of this; let us clear it away.” To which the more intelligent type of reformer will do well to answer: “If you don’t see the use of it, I certainly won’t let you clear it away. Go away and think. Then, when you can come back and tell me that you do see the use of it, I may allow you to destroy it.”

By @prmoustache - 4 months
Web crap blah blah blah... article posted on...Medium!
By @major505 - 4 months
you know, I been programing for 21 years, mostly php, c# and java.

This year i got my first job as exclusively frontend dev using Nuxt.

Not only modern javascript development is a pain in the ass, it makes me feel stupid for not kowing how to do stuff in the modern way.

The other day I had to put a small form made in other portal inside a div in the botton of the screen. This form have a url that can be accessed directly or sent via email.

I through to myself, well I will just used a iframe. Why not?

Well. aparently I had to get a javascript snipet, put in a composable, write a unit test for this composable (so it dont cahnge test coverage). call the composable from inside a component, make a unit test for this new component, call it from the main page.

But hey, nuxt is full of nuxt magic...

1 week to implement, 2 weeks to pass a god damn pull request approval.