Hacker News new | past | comments | ask | show | jobs | submit login

ya'know, everytime there's a post with react in the title, I open it with the best positive attitude I can muster, holding back my knee jerk reaction.

I then read it, and come out thinking "why, why, why do people put up with this absurdity?" and always stop at the same conclusion, cz they don't know any better.

I then quietly move on with my life, sometimes leaving such comments as hints to those who might catch on.




It's the same thing with every technology for me. C++ is pretty absurd, same with Java/Spring framework, ditto for Linux and the whole TTY system/file descriptor hell. Anywhere where someone spends their whole life is probably going to be a big mess.


With all due respect, I believe there is a certain demographic in IT that just has a way too trivial working model of how stuff they don’t work on directly operates.

Like, they know how to do a simple HTTP query in C/go whatever, and then don’t understand why would you need the whole complexity of spring.

It just turns out that the real world is more complex than what they assume - and they are often more than aware of that in their specific subfield.


Yes, and to me the logical conclusion of that is to not worry about how complex React is. I'm sure someone somewhere needed the complexity of each feature somewhere along the line. Is it more than I need? Yes, but maybe someday the complexity will be something I appreciate. And in the meantime, you can just ignore it since it's not directly in your path.


Though the TTY system is clearly historical accident: Hacks piled on hacks on early Unix system to make actual teletypes work, then enshrined in POSIX and need for compatibilities sake.

C++ always seems to me pretty absurd just because C++ people don't seem to know better ways, and seem to think to much about squeezing out the least little bit of performance instead of aiming for simple abstractions that are performant enough. Also, the last 40 years of programming language development seems to be unknown to them, or at least doesn't influence their decisions, or if they pick up a new idea, it's implemented in the most possible awkward way (because, again, performance).


Easy to call it absurd without proposing an alternative. In the real world react solves a ton of problems and lets developers write apps.


I think most people would consider almost any other stack based UI framework that has no fear of stateful components, layout engines with constant solvers, and lets you control when and how to draw frames to be an improvement.

Imagine a world where you just had drawing and input handling primitives on the web. You wouldn't invent the DOM and then something like React to wrangle it that's for damn sure.


> Imagine a world where you just had drawing and input handling primitives on the web.

Good news! We do have those primitives! The canvas element can - and is - used for drawing, and input events are fairly easy to manage. Larger projects like Google Docs or Figma often go in this direction, because for very complicated applications, it's useful to be able to handle every part of the rendering process yourself.

That said, it turns out having a rich selection of easily-debuggable, accessible components attached to a powerful layout engine is also really useful, hence why people mostly stick to the DOM unless they specifically need something that only canvas can offer.


This misses the point entirely, what I mean is that if we didn't already have DOM we wouldn't invent it again — we would invent something like UIKit that has all your premade debuggable accessible components but without the kludge of the DOM.

I think this gets to the core of web devs seemingly not knowing anything else. Not knowing that, from a technology standpoint, how much better you could have it.


No one uses the DOM because they think it’s the best possible GUI technology. They build software for browsers because browsers are the lowest common denominator for distribution, which is far, far more important than technical considerations most of the time. And because of that, there’s also a large ecosystem of well understood, well documented, widely used, beginner-friendly tools for it, ranging from jQuery to React to Tailwind to WordPress.

We can talk all day about how there are better ways to do it, but until you solve the distribution problem, the technology doesn’t matter. Mobile apps sort of solved it, but even then, the bar for installing an app is higher than the bar for clicking on a link. Plus there are cross-platform tech and policy differences to deal with, you can’t guarantee your users are running the same version of the app, etc.


I'm not really disagreeing with you so much as wishing that webdevs had access to a better UI toolkit because the current state of things makes life harder unnecessarily.


the web won not because it was the best technology. the web won because it's basically the one thing that has a standards body and exists on pretty much every device.

writing native apps means having to have basically 4+ development teams for Windows/Mac, Android/iOS, and 5 if you want to have Linux. And it is pretty logistically difficult to herd five separate teams using the same product roadmap because the implementation of one feature can vary so wildly. But if you don't and someone gets a feature someone else doesn't get then people get upset.


The other big piece missing is that desktop-based GUI tools have native primitives that are designed for building complex apps. The web has bits and pieces, but is still a document renderer at its core. I’ve worked in a few of the XML-based GUI tools and MVC frameworks, and none of them were great, especially for real-time information. But at least the native SDKs provide basically everything you need.

I think the reactivity model React has is very compelling, and once you start thinking in terms of “GUI as a function of state,” you start trying to do the same in PHP or Swift and it just doesn’t work out as well. (Though there’s now SwiftUI which is a more reactive way to do iOS GUIs.)

I think react struck gold conceptually, and in a world where the “native sdk” (the browser) didn’t give you much, it became very compelling for many people. I think it has struggled to create intuitive APIs, and has struggled to handle real-world performance without clunky APIs.

Not to mention, browser environments face a slew of problems desktop apps don’t. You have to ship much smaller bundle sizes, no type-safe language, immature language requiring polyfills for useful language features, and the list goes on. Each problem introduces a new tool (webpack, typescript, babel, etc.), and they don’t frequently place nicely together. If I’m writing a Rust or Go program, practically every dev tool I need is part of the language toolchain. And while there are projects that aim to do that for web, they run into the “yet another standard” problem.

Backend has complex problems to solve, but at least you fully control the stack. You can use languages with simple toolchains and good libraries for writing web servers. On the front-end, every library you use is ultimately at the whim of the browser.


at the end of the day it is really about which poison you would pick; one team dealing with one complicated toolchain or five teams with their own bespoke OS-specific toolchains that can barely coordinate. They're both not good choices; and in an era that until recently was an era of dev scarcity, a lot of companies picked the former choice.

people also really hate feature gaps between platforms. so option one makes your customers less angry at you.


> Imagine a world where you just had drawing and input handling primitives on the web. You wouldn't invent the DOM and then something like React to wrangle it that's for damn sure.

I think this is a really good thought experiment and that you are right - we wouldn't end up with the DOM if we started from scratch. It's a pretty bad local optima resulting from decades of legacy cruft. However, I do think react is closer to that ideal than the DOM.


>You wouldn't invent the DOM and then something like React to wrangle it

Then you'll also have to reimplement accessibility features yourself. For a lot of use cases, that isn't worth the trade-off, imo.


> "why, why, why do people put up with this absurdity

For all of Reacts faults, it's not particularly absurd to use in practice and ultimately there's only one frontend/client language to work with.


Like, what is better? GUIs are hard, the old way was duplicating state at the ”view” and the “model” layer, resulting in millions of bugs. The core idea of react v=f(m) is sound, and is the correct approach. Also, react itself is not even that complex.


Are you an experienced UI developer that knows of something we should all use instead? Even if it's non-web I'd love to hear about it. We all would. Then we might take inspiration from it and build a new web framework.

Pretty much no one that uses React _loves_ it. But we all use it because it gets the job done.


So what should they be using, if they did know better?


What’s absurd about it? What’s a better option in your opinion? Asking as someone who mostly knows the React approach


Just generate a web page on the backend.

Sprinkle it a bit with some simple JavaScript/jQuery code for animations, forms checking etc, if you want. That's it. That's how it was supposed to work and that's how it works best. JavaScript was made to make the monkey dance. The end result, either made with overcomplicates frameworks like React/Angular or with simply generating the web page on the backend, is irrelevant to the user.


Agreed with “just generate a web page on the backend”. But if the webapp is sufficiently complex (all websites I have been paid to work on have been), you need a component based framework like React to make the creation of the page manageable




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: