News for hackers. Stuff that matters.
Re:React is a fractal of bad design by Illniyar on Wednesday March 08, 2023 @03:48AM (#35066738)
I'm still a React guy. I've also worked with Angular and Vue and toyed with Svelte.

People tend to compare these frameworks on things that don't matter - often it's performance. We used to compare React performance to AngularJs performance too, which was meaningless.

VDom is nice. Reactivity in signals is nice. Limiting rerenders is nice. But I choose frameworks because of developer ergonomics.

The killer feature for React was - 1. JSX - typing and auto-complete for components, colocation. 2. No direct dom access. (Good bye $element)

Most frameworks outside react still use templates. Even when they support JSX like syntax (aka vue 2.0) the default are templates. Templates are a no go for me. I use them for blogs or static websites, but applications are easier to make and maintain with actual javascript.

Luckily none of the other frameworks, even Angular, have rampant direct dom access anymore.

Hooks aren't a problem in general. It's just the useEffect hook. Unfortunately that's a big problem. That hook should never have existed. And it was clear from the start it'll be a pain from the limitations around it. It requires a mental model detached from everything people are used to and from other things around it.

When using React I usually just use MobX and everything just works.

Re:React is a fractal of bad design by theteapot on Wednesday March 08, 2023 @04:30AM (#35066965)
> Most frameworks outside react still use templates. Even when they support JSX like syntax (aka vue 2.0) the default are templates. Templates are a no go for me. I use them for blogs or static websites, but applications are easier to make and maintain with actual javascript.

I've gravitated away from React towards Vue v3. Templates are working fine, well even. You still use similar amount of Javascript (probably less).

> It's just the useEffect hook. Unfortunately that's a big problem. That hook should never have existed.

Weird. useEffect is like the archetypal hook. The problem it purportedly solves was one of the main arguments they made for hooks existing in the first place -- https://reactjs.org/docs/hooks-intro.html#motivation. They just implemented it in a clunky way, and actually the problem could have been solved in an OO fashion with going to hooks at all, but now everything is a fucking hook.

Re:React is a fractal of bad design by Sammi on Wednesday March 08, 2023 @05:07AM (#35067195)
I'm interested in hearing more about that last point.
Re:React is a fractal of bad design by Illniyar on Wednesday March 08, 2023 @06:09AM (#35067600)
>Weird. useEffect is like the archetypal hook. The problem it purportedly solves was one of the main arguments they made for hooks existing in the first place -- https://reactjs.org/docs/hooks-intro.html#motivation. They just implemented it in a clunky way, and actually the problem could have been solved in an OO fashion without going to hooks at all, but now everything is a fucking hook.

There was (and still is) a real problem in react with composability. Which they tried to solve with mixins, then HOC and then hooks.

The three main hooks are useState, useContext and useEffect . useState and useContext are very straightforward and an overall improvement on their previous counterparts. useEffect was an improvement over mixins, but it was a worse solution for class component lifecycle methods.

It was fairly obvious that useEffect had a lot of problems from the get go, but it was deemed worthwhile to add so that functional programming proponents could have state without classes and to finally have a way to use composability without the horribleness of mixins and hocs (which were worse then useEffect).

The real problem is that useEffect has it's own problems, and while we no longer have the old problems, the new problems might be worse.

Re:React is a fractal of bad design by larsnystrom on Wednesday March 08, 2023 @06:14AM (#35067643)
You keep saying useEffect has problems but you never mention what those problems are.
Re:React is a fractal of bad design by Illniyar on Wednesday March 08, 2023 @08:06AM (#35068514)
Sorry. The biggest problem is that useEffect's mental model is based on data change and not on events.

So instead of "do something when this action/event happens" we get "do something when this data changes". Which ends up being abused a lot, as developers who aren't familiar with this mental model (which is most of them), tend to lump up every action into a data change.

So instead of something like (contrived example):

  openAlert() {
    alert("I'm an alert");
  }
  return <button onClick={openAlert()} />
people do:

  const [alertOpen,setAlertOpen] = useState(false);
  useEffect(()=>{
    if (alertOpen){
      alert("I'm an alert");
    }
    return ()=>setAlertOpen(false); //if they even remember to unregister
  },[alertOpen])

  return <button onClick={()=setAlertOpen(true)} />
Beyond that there are multiple other problems:

- the fact that useEffect (and hooks in general) is order dependent and can't be put inside branching (so I can't start an affect after an event happens).

- the fact that inside useEffect you read the data of the previous render is very unintuitive (I.E. your data is stale).

- the need to always put all your dependencies that are used inside useEffect in the dependency array explicitly - which can be even harder when dependencies are dynamic - is also a problem for many.

There's probably a few more, but that off the top of my mind.

The fact that there needs to be several eslint rules in order for people to not footgun themselves constantly is quite a red flag on it's own.

Re:React is a fractal of bad design by larsnystrom on Wednesday March 08, 2023 @09:37AM (#35069440)
I think your example was good, but I disagree with your conclusion. In your example, the hooks version renders the UI based on data/state. In the non-hooks version, the state of the rendered UI depends on ephemeral events and the order they were dispatched. The hooks version is more easily tested and it's easier to reason about as a developer. It conforms to the mental model of a function (props, state) => UI. The non-hooks version would look like (props, state, actionHistory) => UI, where actionHistory is a list of all actions the user has taken since the app was initialized. With that function, we can't reproduce UI, because we don't have actionHistory (since the events triggered by the actions has not been recorded).

And are you sure the data in useEffect is stale? I don't think it is, the documentation[0] seems to suggest that it uses the current closure.

The rest I agree with.

[0] https://reactjs.org/docs/hooks-effect.html#example-using-hoo...

Re:React is a fractal of bad design by ENGNR on Wednesday March 08, 2023 @03:35PM (#35074394)
Also I’m pretty sure it don’t add data dependencies! Only the the dependencies that retrigger the effect
Re:React is a fractal of bad design by c-hendricks on Wednesday March 08, 2023 @03:36PM (#35074397)
This pattern (event -> state change -> effect run) is finally advised against in the new React docs: https://beta.reactjs.org/learn/you-might-not-need-an-effect

See "You don’t need Effects to handle user events".

Re:React is a fractal of bad design by thegeomaster on Wednesday March 08, 2023 @04:03AM (#35066824)
How is performance not important in this context?

React is very sluggish when updating many elements at once, for not very large values of "many". With some regularity, I've debugged React+MobX jank issues where a bigger update, such as switching from one panel to another, takes upwards of 200ms on a mid- or low-range machine.

None of this is perceptible on our beefy dev boxes, which is why I think people disregard it, and why the modern webapp experience is so miserable for the average person.

Re:React is a fractal of bad design by codeptualize on Wednesday March 08, 2023 @05:14AM (#35067238)
> the modern webapp experience is so miserable for the average person.

I see this claim a lot and I'm curious what this is based on, can somebody drop some links to further reading?

Re:React is a fractal of bad design by iakov on Wednesday March 08, 2023 @05:39AM (#35067398)
It feels like a myth to me as well. We, tech nerds, value "optimized" solutions, "beautiful" code. We buy top-notch hardware, remove bloatware, because we really care about our tools and craft.

90% of the users use shitty hardware. Everything is sorta sluggish on their computers - they boot up slowly, the bunch of crapware in autorun take their sweet time to load & phone home, their wifi us overburdened with devices. Most of the software experience is sluggish for them. They don't care if their web app is sluggish too.

Re:React is a fractal of bad design by thegeomaster on Wednesday March 08, 2023 @05:53AM (#35067500)
Doesn't that have a corollary: if their web app is faster than everything else they use, won't they love it?

Anecdotally, those 90% of users are not happy about their experience, they just tolerate it.

Re:React is a fractal of bad design by xmcqdpt2 on Wednesday March 08, 2023 @06:57AM (#35067946)
I think if that was the case Apple would be a much smaller company. People buy iPhones because they "feel nice." And the feel they are talking about is performance.

If you are forced to use an app with bad performance (say Teams) you cope. Humans are great at coping. Maybe you turn it off and back on again periodically, or alt tab to something else while it's showing a spinner.

It's true performance isn't a major selling point but IMO that's because most software products are not sold to users. They are packaged with other products, part of monopolies and imposed to users by others.

I buy video games where performance undoubtedly matters. Apart from that, most software I use, I didn't choose, and I'm pleasantly happy when it's not garbage (Outlook, IDEA) and annoyed when it is (Teams, Facebook). In either case, performance wasn't a contributor to my choice: I didn't have a choice.

Re:React is a fractal of bad design by kunley on Wednesday March 08, 2023 @11:13AM (#35070809)
All good except of the last sentence.

All the sluggish steps led them to the usage of the web app they need to use, and they need it to be fast. At least, faster than rest of the crap so far. Heck, they may spend rest of the day with this app..

Re:React is a fractal of bad design by marginalia_nu on Wednesday March 08, 2023 @05:20AM (#35067275)
Try getting a slightly shitty phone and visit a place with spotty wifi that drops some packets. It's very enlightening.

I'm averaging a 15-30 second TTI on the most js-heavy sites.

Re:React is a fractal of bad design by gurraman on Wednesday March 08, 2023 @05:25AM (#35067304)
Same. We've been working on a huge React project for several years. Lots of graphs, 3d models etc ... and it is super-snappy. Only slow part is a WebGL-based chart component that visualizes 2-3 M rows of signal data. We can probably decimate the signal data to improve performance, but that has got nothing to do with us using React.

N.B. No one is using the app from their mobiles. iPad and computers only.

Our reasons for choosing React when there are so many alternatives: prior knowledge, ergonomics, easy onboarding, ecosystem.

Re:React is a fractal of bad design by dham on Wednesday March 08, 2023 @08:00AM (#35068461)
Super-snappy for who? You? with a $4000 Mac Book Pro? Even with 6x CPU slowdown in Chrome, that's not enough throttling for these modern computers to test with.
Re:React is a fractal of bad design by eastbound on Wednesday March 08, 2023 @01:04PM (#35072451)
Modularization. With React, you can delegate a component to one team and use it as a web-component.

Actually, why aren’t web-components a thing, that’s another story. But componentization is why React creates clean code.

Re:React is a fractal of bad design by DoesntMatter22 on Wednesday March 08, 2023 @03:20PM (#35074210)
I make this argument all the time and people think I'm an idiot, which is fine. But JSX to me is reason that Svelte and Vue aren't as good. They are faster IMO but with JSX it's nice that you can make a form and then each part of the form can be broken out into separate methods.

The reasoning I get all the time is "Why would you want to do that? That's stupid".

It's just so much nicer honestly. I'm not a react fan at all but that's one thing I miss about it.

Re:React is a fractal of bad design by josephg on Wednesday March 08, 2023 @09:58PM (#35077851)
Huh? All of the modern web frameworks let you delegate a component to a team and use it. What does react do here thats special?

Honestly, if anything I find react's modularity story much weaker than the competition. In react there's no page-wide state and the story around styling components with CSS is a huge mess.

In comparison, Svelte components feel much more modular & self contained because the styles are embedded with the component in a standard way.

Re:React is a fractal of bad design by favaq on Wednesday March 08, 2023 @05:54AM (#35067507)
Buy the average $400 windows laptop and $250 android phone and you'll see.
Re:React is a fractal of bad design by agloe_dreams on Wednesday March 08, 2023 @09:53AM (#35069671)
Would you? Most $400 laptops are on 10th gen Intel or such. Thats actually pretty good. A Pentium Gold is actually just on the edge of a modern i3 which in single core. Smokes most 8th gen chips. They are pretty good.

$250 in an Android phone can get you a SD 695 5g these days. IT's not fast per say but it absolutely doesn't suck.

Re:React is a fractal of bad design by josephg on Wednesday March 08, 2023 @10:20PM (#35077965)
Yeah I agree with the GP. Most $400 laptops come pre-loaded with all sorts of janky crap that make that 10th gen intel CPU run like a wounded animal.

Most users have no idea how to remove any of it. Or, worse, they'll enable all of the preinstalled antivirus programs because they want their computer to be safe. And it gets worse. I visited my parents once and noticed something weird on my dad's macbook air. Turned out he'd gone out and bought Norton antivirus to install on it (!?). Norton installed a chrome extension which replaced the banner ads on every website he visited with their own ads. I manually deleted the extension from chrome, but norton put it right back again after chrome restarted.

If you don't believe me, use performance counters and measure it. Your website runs way slower on your users' computer than you think it does.

Re:React is a fractal of bad design by agloe_dreams on Thursday March 09, 2023 @06:27AM (#35080250)
Oh I know, but that situation has become less common over the years. Fewer users are buying AV and most AV is getting better so people don’t complain. Users using outdated versions of Windows with IE has a much larger impact (because IE’s JS engine is incredibly awful)

But the point I was making was that the average computer has actually gotten pretty good. Most users use near-latest chrome, most laptops have gotten much quicker.

And that’s before noting that the average cell phone in the US has BETTER js performance than the average computer. Most US mobile users have a modern iPhone that is faster in single core performance than some 10th gen laptops.

Re:React is a fractal of bad design by unxdfa on Wednesday March 08, 2023 @06:00AM (#35067542)
Try selling React shit to corporates who have corporate malware infested Edge running on overloaded Citrix nodes or the average corporate android that was made about 3 years ago.

We still get <100ms page delivery with server side rendering and lightweight JavaScript DOM overlays. Our React infested competitors, not so much to the point their clients have been shitposting on twitter about it.

And we actually can debug our product!

Re:React is a fractal of bad design by davidy123 on Wednesday March 08, 2023 @06:16AM (#35067665)
I don't think you are living in the real world. Is Microsoft corporate? React is a first class choice in their frameworks.

React is like nearly any other tool, use it well, and it's great. Well optimized React is lightweight to the client and a joy to test and debug. That said, Web Components are even better, but I'm guessing that's science fiction to you.

Re:React is a fractal of bad design by unxdfa on Wednesday March 08, 2023 @06:20AM (#35067690)
I don't think you are living in the real world.

Most React applications do not end up like that in the real world. They turn into poorly architected over complicated nightmares, particularly on sprawling apps which is the reality in the corporate space. Not everyone is building hyper-focused single function tools which can be crammed in an SPA type framework. And the users suffer for this.

One of the finest turds I've seen recently is my electricity company's meter reading facility which is an over-engineered react interface for a single web form with two fields and a confirmation box. The whole thing pulls 590k down to do that and takes 5 seconds for the initial page load on an M1 MacBook Pro. That's the real end game for most people. The only reason it's like that is because the people who built it don't know how to do it any other way.

And lets be honest about Microsoft: they do everything from a front end or user interface perspective and randomly discontinue bad ideas about 5 years down the line. Like Silverlight, most of WPF, bits of ATL and MFC, an entire mobile phone platform that got rewritten. And their competing framework WinUI 3 doesn't even work properly. Their own O365 web platform is a fine example of where this turns into a buggy mess. I bet react is dead to them within 2 years on one of their schizophrenic switcharoos. The only reason they're into it now is to capture some market from Electron.

Re:React is a fractal of bad design by nerdywordy on Wednesday March 08, 2023 @06:46AM (#35067863)
RE: Microsoft

1) MSFT has already used React for far longer than 2 years.

2) They have basically never used the technologies you mentioned (WPF, Silverlight, WinUI). They offer them as UI toolkits that run in their Windows environment and that’s it. Their failure to market and support these technologies is independent of what they do for their own development strategy.

3) They bought GitHub and effectively own electron now. Many of their biggest apps are on electron (Teams, VS Code, Azure Data Studio).

Re:React is a fractal of bad design by unxdfa on Wednesday March 08, 2023 @09:48AM (#35069579)
1. Correct.

2. Yes they have. Half their developer tools were rewritten in WPF, they offered huge stacks including CRM on top of Silverlight and a huge chunk of windows 11 front end is WinUI.

3. Teams fucking sucks. VS Code is heading in the same direction. I've never used Azure Data Studio.

Re:React is a fractal of bad design by josephg on Wednesday March 08, 2023 @10:12PM (#35077920)
> Many of their biggest apps are on electron (Teams, VS Code, Azure Data Studio).

Huh? Those are Microsoft's biggest apps? Not, MS Word, the NT Kernel or ... windows 11? The XBox operating system project? Outlook express? Visual Studio? ... Github?

I'll grant that Electron is used by a few teams at microsoft. But I'd be surprised if even 1% of microsoft's engineers worked on products built with electron.

Re:React is a fractal of bad design by davidy123 on Wednesday March 08, 2023 @06:48AM (#35067879)
I can look at the javascript of many "big corporate" websites and see they are often a sprawling mess of homebrew code. I'm sorry your electricity company's React website is bad, but I don't think an anecdote is data. Any framework can get abused, not using a framework doesn't mitigate the problem. But trying to update a site that uses a different approach for every little feature spread across many pages, without any idea of what a component is, that's a nightmare. At least you can sensibly incrementally improve React across a site's components with well worn tools, especially as a team.

I don't love Microsoft, but it's for the best they adopt a well known and rounded framework like React, rather than try to invent yet another of their own frameworks, like the ones you mentioned. I don't know why this has anything to do with Electron, since their React push is for their front end frameworks for their main corporate product, Office365 (or whatever it's called today).

Re:React is a fractal of bad design by danielvaughn on Wednesday March 08, 2023 @08:32AM (#35068750)
I think what you're criticizing isn't react necessarily, but SPAs. React can be used on the server in the same way as whatever SSR solution you're using.
Re:React is a fractal of bad design by adql on Wednesday March 08, 2023 @09:53AM (#35069670)
Both Discord and MS Teams use React (afaik) and only one of them runs shit.

Both are not exactly light tho

Re:React is a fractal of bad design by unxdfa on Wednesday March 08, 2023 @03:42PM (#35074450)
Both of them run like shit in my experience. I mean Discord is basically mIRC that looks a bit better with a shit version of zoom strapped on the side.
Re:React is a fractal of bad design by josephg on Wednesday March 08, 2023 @10:02PM (#35077862)
Yeah; and mIRC opened faster in 1997 than discord does today on a $3000 M1 mac.
Re:React is a fractal of bad design by akudha on Wednesday March 08, 2023 @06:03AM (#35067559)
I have a beefy machine and fast internet. Yet, JIRA is annoyingly slow. Half the time, pages on my bank’s website take forever to load, or don’t load at all.

I don’t have any numbers, just some anecdotal experience like the above.

It is not just speed. The UI of many sites suck too. Amazon, GoDaddy, for example.

Then there are ads. We don’t see ads in between content anymore. It is content within ads these days.

I am thankful that we can do so much online these days. But the experience could be better

Re:React is a fractal of bad design by scotty79 on Wednesday March 08, 2023 @06:07AM (#35067585)
Isn't Jira server-side rendered?
Re:React is a fractal of bad design by p_l on Wednesday March 08, 2023 @08:38AM (#35068813)
Nope, a lot of JIRA runs in the browser.

But JIRA main performance issues in my experience are caused by badly sized servers for the level of use.

Re:React is a fractal of bad design by SgtBastard on Wednesday March 08, 2023 @06:51AM (#35067900)
Jira is a not very good product, implemented by worse engineers, that happens to be better than its competitors (ironically proving the point I made further up thread).
Re:React is a fractal of bad design by thiht on Wednesday March 08, 2023 @12:05PM (#35071603)
> implemented by worse engineers

Jira is a 20 years old piece of software. I'm sure today's engineers do their best with the constraints they have. And I'm sure the 2002 engineers did their best with this period's assumptions and solutions.

I hate Jira as a product, but please don't attack people like that, have you never had to work on a product you're not 100% satisfied with? :/

Re:React is a fractal of bad design by SgtBastard on Wednesday March 08, 2023 @03:43PM (#35074467)
https://www.atlassian.com/engineering/post-incident-review-a...

I stand by what I said.

>I’m sure todays engineers do their best with the constraints they have.

There are two real constraints in the software engineering world: time and money (especially when we’re talking about an issue tracker, a wiki and a repo + CI\CD pipeline).

That Jira and confluences performance remains … not very good, suggests that the engineers are unwilling to, or unable to advocate for, spending the time and money to address this.

Re:React is a fractal of bad design by nazgul17 on Thursday March 09, 2023 @02:55AM (#35079173)
Hasn't Jira been rewritten from scratch a few years ago?
Re:React is a fractal of bad design by krautsourced on Wednesday March 08, 2023 @08:03AM (#35068488)
In the case of Jira, how much of that is related to frontend code, compared to backend code / inefficient queries?

I find performance suffers mostly when media assets, advertisments, marketing and tracking scripts etc. come into play. The frontend rendering rarely makes a dent at that point.

Re:React is a fractal of bad design by DoesntMatter22 on Wednesday March 08, 2023 @03:17PM (#35074176)
The FE is like 5% of the slowness if that. You have a 2 second query and then 50-100ms to render.
Re:React is a fractal of bad design by Cthulhu_ on Wednesday March 08, 2023 @09:20AM (#35069232)
JIRA, Amazon, possibly godaddy all predate modern-day tools like React and Angular by at least a decade though; Jira seems to have a custom set, Amazon probably does as well.

But in most cases, front-end technology isn't the limiting factor.

Re:React is a fractal of bad design by agloe_dreams on Wednesday March 08, 2023 @09:51AM (#35069615)
The problem with Jira...is that it isn't for you.

No really. It is a B2B company that sells an idea to large orgs. "Know what is happening for everything and where you will be in a month.

It is not "Enable your workers to work more efficiently".

Jira simply doesn't really care about the average dev or such. In fact, most orgs use such a wildly configured version that it is pretty absurd.

Let me give you an example: Most companies have a workflow: To Do > In Progress > Testing > Done.

Foundationally, Testing and In Progress are tasks done by different operators. Jira doesn't, out of the box, conceptualize who tested a ticket and who developed it. It is all one field. You don't have seperate pointing for testing and development so you can't track QA capacity (Which is helpful to a team but not to overall planning as it just causes rushed QA). You don't have historical views of prior sprints "What was that Ticket I worked on last sprint?" (because that means nothing for forward velocity other than the final number) I could go on..but it all leads back to an absurd UI focused purely on projects and velocity above helpfulness. (And don't get me started on Jira's absurd take on SCRUM) Honestly, I'm kinda shocked no major software company has not just built their own and knocked Atlassian out of the park. I'm sure tracking velocity of other companies would be highly...helpful for Google/MS.

Re:React is a fractal of bad design by KronisLV on Wednesday March 08, 2023 @11:40AM (#35071205)
> The problem with Jira...is that it isn't for you.

It's more or less one of those enterprise software packages that will be depended upon in larger orgs, because "nobody ever got fired for choosing $VENDOR". That sort of software tries to do a bit of everything, provide lots of features and customizability, sometimes at the expense of being more complex, bloated and slow.

Most people working on their own projects, when fully in control of the decision of what software they want to pick to best suit their own direct needs, might settle on something like Trello or even Kanboard instead. Personally, I self-host OpenProject because its features are a nice fit for my needs, even if it's still a bit sluggish (Rails app, limited hardware resources). Honestly, the performance of Kanboard was blazing fast when compared to anything out there - which is in no small part thanks to how focused and minimalist it is, which in some cases will be exactly what you'll want.

As another good example, I'd also put something like the Oracle database in same category: there will be many projects out there developed around it, as well as lots of knowledge, training, as well as entire professions built around it. But most people won't necessarily reach for something like Oracle XE for their own personal projects, they'll instead pick something like PostgreSQL or MySQL/MariaDB, because both of those are a little bit simpler to get started with and keep running, while still provide sufficient functionality.

This is an anecdote, but recently I launched all of the mentioned database options one after another in containers, for some testing. Oracle took around 10-20 minutes to start up an de usable. MySQL took about 5-10 minutes to become available for connections. PostgreSQL needed just 2 minutes. That's even before I get into how much data Oracle created in a container volume meant for data persistence (an order of magnitude more than MySQL or PostgreSQL).

Re:React is a fractal of bad design by DoesntMatter22 on Wednesday March 08, 2023 @03:16PM (#35074166)
Most of JIRA being slow is the backend not the FE. I've had the same issues but you can watch the backend take 3 seconds to return. The FE isn't much of a factor there.
Re:React is a fractal of bad design by modo_mario on Wednesday March 08, 2023 @06:09AM (#35067598)
In my case it's extensive anecdotal experience. First when I was a budget constrained student with bad hardware. Of course now I use a really good midrange phone, good laptop and pc.

Then i noticed a stark differences in attitude in the 2 studies I did at uni. One was more plain compsci. The other more web/mobile design and development. The later paid absolutely 0 attention to optimisation. Whether it was speed, download size or anything of the sort. The former treated an inneficient slution as invalid or at least graded lower. (Note this was in Beligum)

First time I started paying more attention to this where it wasn't when it wasn't in the context of being a budget constraint student was when I did a temporary IT support stint at a gigantic international pharma company and the software was so sluggish it was....insane. Dozens of people at our facility staring at a slugish webinterface waiting at every action and doing loads of those for every ticket. It was so infuriating I tried to make a browser plugin to prefill stuff with comon defaults the moment they were available knowing I'd never use it beyond those 3 months. Years of time must've been wasted staring at little loading circles because management did not use the software.

Then when I made native software for a manufacturing industry niche where i was told some suggested db retrieval and prerendering optimisations and such weren't worth the time....And sure. These were lowwage foreign workers using it, it didn't hamper much at all and our time was expensive. Maybe the business wouldn't get the money out of it....but then i ventured to production and notice more than a hundred people pulling the same actions many times a day thousands of times a year ....and see them waiting split seconds or multiple seconds depending on the actions that counted up to combined wasted minutes, hours, days, weeks and I realised what a load of bollocks it was.

Additionally when I helped extend various ERP's I realised the old ones were faaar from great but the move to web based interfaces really didn't do us much favours.

Then I come home and try to help my various layman family members on their comparatively slower windows and android devices and it becomes veeery apparent that this is not just a professional software issue. Slugish UI libraries on slugish frameworks on a slugish OS with various other slugish apps.

Coming home to a fast pc running Linux and using stuff i write in my free time using C++ or rust or even just various native apps on windows feels like such a extremely stark contrast.

My conclusion is that users won't care enough up to a certain point as studies show However I do believe that what those studies don't show is that for a good part this is because it's the default for many of them. They think this is just what tech is and all those countless small waittimes behind actions is normal.

Re:React is a fractal of bad design by codeptualize on Wednesday March 08, 2023 @07:01AM (#35067972)
I’m seeing a lot of anecdotes, not a lot of research.

Nngroup used to publish analyses of the state of usability, but I don’t think they have done one recently.

The old ones always showed progress, and that’s also what I would expect talking about the average situation.

Average progress doesn’t mean there are no shitty situations and we should always strive to improve, I just think claims like this are not helpful as they are used to make blanket statements about nuanced situations.

Unless you can back them up of course, and I would still love to see the data if anyone can find it.

Re:React is a fractal of bad design by resonious on Wednesday March 08, 2023 @07:13AM (#35068076)
Sadly all I have is more anecdotes, but you can get those yourself by asking any non tech worker what they think of using any software.
Re:React is a fractal of bad design by codeptualize on Wednesday March 08, 2023 @08:15AM (#35068588)
I've been involved in quite a lot of usability testing and I'm often positively surprised by the responses. Which is why I'm sort of skeptical when reading such claims. Also because I think user experience overall has improved, by a lot, the standards now are so much higher than the used to be.

I think it almost always comes down to one thing: Can people achieve the thing they want to achieve in a somewhat efficient way?

If the answer is yes there is lots of tolerance for all sorts of crap before people experience it in a negative way.

That means managing the experience. As example a multi minute upload process can be totally fine if handled properly, a .5s delay on an input can make it unusable. My point being; reality is a lot more nuanced than the blanket "it all sucks, and performance is everything" statement, and personally I don't think it's helpful. Unless we can actually look at metrics and assess their importance and how we can address them.

Don't get me wrong; we should absolutely keep trying to improve, especially crafting well made usable interfaces that are a delight to use. Performance is certainly very important, but it's not the be all end all of user experience and atm wrongly used to justify silly points why [my fav framework] is so much better than React.

Re:React is a fractal of bad design by 0xblinq on Wednesday March 08, 2023 @04:47PM (#35075200)
Just go and use the “new” Reddit. Take any metric you want from there.
Re:React is a fractal of bad design by brettermeier on Thursday March 09, 2023 @05:36AM (#35079979)
The new Reddit is so slow... after some bingescrolling I often give up due to the annoying loading times and close the site. I always imagine that many people react like this on super slow websites, but on the other hand it's Reddit and many people don't know which site to visit instead :P
Re:React is a fractal of bad design by 0xblinq on Friday March 10, 2023 @11:22AM (#35096473)
Try https://old.reddit.com

The day they disable it, I’m not using it anymore.

Re:React is a fractal of bad design by colin_jack on Wednesday March 08, 2023 @06:37PM (#35076286)
This is part of a whole series of posts:

https://infrequently.org/2022/12/performance-baseline-2023/

Re:React is a fractal of bad design by Illniyar on Wednesday March 08, 2023 @05:24AM (#35067299)
Performance of frameworks is often irrelevant for products/applications.

1. Performance is very very rarely a contributor to a product success. Users prefer more features over more performant app all the time (both directly when asked and indirectly by what products they choose).

2. Rendering/client computation speed is rarely a contributor to real and perceived performance. It's almost always the async calls - how many you have, and how long they take. It's almost always a waste of effort to try and make your framework render at half the time when 99% of your lag is a database call.

3. Framework performance is rarely a contributor to the speed of your rendering. It's most often a problem with how you structured your app. You can structure your app poorly in any framework. (I would hazard a guess that in your panel switch example a differently structured React+MobX solution would not have the problem you described)

4. There are only very few scenarios where the rendering speed between frameworks makes a perceptible difference (usually when talking about large tables or similar scenarios), in all other cases it's a difference of a few milliseconds.

Re:React is a fractal of bad design by sakex on Wednesday March 08, 2023 @05:38AM (#35067388)
You'll need some data to make those claims.
Re:React is a fractal of bad design by thegeomaster on Wednesday March 08, 2023 @05:58AM (#35067534)
1. The obsession with measurable "product success" is part of the problem. Nobody will tell you they prefer your app because of performance, because it's not a perceptible thing your average user will notice. Features are much more important, true. You shouldn't care about performance at all for a prototype, true. But when you have an established product, not caring about the speed at all is a mistake IMO. This also has second-order effects for battery life, for example.

2. True, it depends on the type of app. For anything that is a type of "editor" - website builder, word processor-like thing, kanban board - you operate on a data model that you save in the background. Async calls are fairly unimportant for the overall feel there.

3. To me it's hard to untangle. The reigning paradigm is declarative UI, for great reason. It's so much saner than any manual updates. But this encourages a design where you don't think about what DOM updates will really happen after an action, and this is where the problem lies. A big part of it is also the DOM model and layout. In the extreme, you have a declarative UI library like ImGui which doesn't have any VDOM, it just rerenders every frame, and it's insane how quick it does it. I haven't been able to bring it to its knees, it just maintains 60FPS constantly, with a lot of frame time to spare.

4. It's not hard for me to believe this. I didn't say other frameworks are better. Could be that the whole DOM diff approach is the culprit, or the slowness of DOM updates and relayouts.

Re:React is a fractal of bad design by vouwfietsman on Wednesday March 08, 2023 @06:07AM (#35067591)
Although I agree with the sentiment of your post, #1 is blatantly wrong.

Most of my successful work has been specifically outperforming the competition in a way that makes users choose our product. Performance is an orthogonal feature that improves all other features, and even changes what your clients can do with your system, as in making new workflows viable.

Re:React is a fractal of bad design by dagorenouf on Wednesday March 08, 2023 @06:26AM (#35067727)
That’s highly dependent on the type of product / customers you have. If you’re running an online shop selling ice cream, going from 100ms to 2ms list sorting speed isn’t gonna get you more sales. I’d argue most online products are ice cream shops to some degree.
Re:React is a fractal of bad design by vinay427 on Wednesday March 08, 2023 @07:01AM (#35067976)
The data seems to indicate otherwise: https://www.gigaspaces.com/blog/amazon-found-every-100ms-of-...

> A 2017 Akamai study shows that every 100-millisecond delay in website load time can hurt conversion rates by 7%

> 10 years ago, Amazon found that every 100ms of latency cost them 1% in sales

Re:React is a fractal of bad design by undefinedzero on Wednesday March 08, 2023 @07:15AM (#35068097)
With SSG and to a lesser extend SSR, React has close to zero impact on the initial page load. It’s all just HTML.
Re:React is a fractal of bad design by taeric on Wednesday March 08, 2023 @10:30AM (#35070211)
Would be fun to see that revisited.

Also misleading to imply a linear relationship. There will be a marginal cost, but no reason to assume constant.

Re:React is a fractal of bad design by jokethrowaway on Wednesday March 08, 2023 @06:10PM (#35076079)
That study doesn't prove anything.

You're not amazon

That said, having a performant website is nice, both for developer experience and for users.

I have to say I pick solid because it's so damn fast (okok, and because it has an API which is React-like but without the crap doesn't make sense or an extra custom runtime just because)

Re:React is a fractal of bad design by gorm on Wednesday March 08, 2023 @08:48AM (#35068914)
Try to do an a/b test and see the results for yourself. Also remember that those 100ms can in some scenarios turn into 300ms if you are not running on state of the art hardware, like most developers does.
Re:React is a fractal of bad design by 0xblinq on Wednesday March 08, 2023 @04:41PM (#35075140)
That’s just your gut feeling, not what actual data shows.
Re:React is a fractal of bad design by humanrebar on Wednesday March 08, 2023 @06:08AM (#35067595)
> Performance is very very rarely a contributor to a product success. Users prefer more features over more performant app all the time (both directly when asked and indirectly by what products they choose).

I close sites all the time when they fail to work quickly. I have aborted orders on sites midway through when the interaction became sluggish enough that I wasn't confident in the value of the product anymore.

This statement reminds me of those Gordon Ramsay shows where a restaurant owner says "the customers like my food!" when it's obviously subpar. The fact is that the customers that didn't like the food politely go away and don't come back.

Your other points get more directly at framework performance versus other performance concerns. I have fewer opinions about those.

Re:React is a fractal of bad design by Illniyar on Wednesday March 08, 2023 @06:33AM (#35067774)
And I never click on Ads. Yet they work and drive a lot of traffic and money to sites. (Even after all the fraud)

Products almost never compete on performance, and the biggest, most popular ones are almost always the slower ones.

Regardless of your anecdotal evidence, there is a reason why this sentiment is prevalent in the industry - because PMs and devs who thought otherwise were quickly outcompeted by those that moved faster and released more features.

Re:React is a fractal of bad design by holbrad on Wednesday March 08, 2023 @06:58AM (#35067954)
Performance is obviously important, to suggest otherwise is just silly.

Both Google and Amazon have researched this topic and the results are readily available. First link I found: https://www.thinkwithgoogle.com/marketing-strategies/app-and...

Why do you think there some much time and effort going into improving performance of computing in general. Facebook Lite, android go, GPU's, cpu improvements, 5g, etc.

The important caveat is that once it's fast enough the gains are marginal.

Re:React is a fractal of bad design by jameshart on Wednesday March 08, 2023 @07:51AM (#35068363)
Performance is obviously relevant in the margin. A performance improvement in your site might decrease dropoff or churn by something like 1-5%, which is a good number, and it will compound.

But if you are still at the stage in product development where adding features will increase your addressable market by tens or hundreds of percents (which doing things like ‘supporting multiple European languages’ or ‘adding google login’ can do) then those performance gains are not where engineering investment needs to go.

Re:React is a fractal of bad design by snarfy on Wednesday March 08, 2023 @07:57AM (#35068430)
Arguing features vs performance is really about which features are more important. Performance is just another feature.

I use Vim and I use VSCode. There is little debate about which has better performance and which has more features. It's also easy to see which has more users.

Re:React is a fractal of bad design by larksimian on Wednesday March 08, 2023 @11:31AM (#35071091)
Is it vim in all 3 categories?
Re:React is a fractal of bad design by tarboreus on Wednesday March 08, 2023 @03:56PM (#35074603)
Just two of them.
Re:React is a fractal of bad design by satvikpendem on Wednesday March 08, 2023 @10:10PM (#35077911)
Or just one.
Re:React is a fractal of bad design by 0xblinq on Wednesday March 08, 2023 @03:42PM (#35074455)
If you think Vim has less features than VSCode you haven’t used vim enough.
Re:React is a fractal of bad design by InsomniacL on Wednesday March 08, 2023 @09:17AM (#35069202)
> The important caveat is that once it's fast enough the gains are marginal.

Based off how slow every SaaS service is in the B2B space, performance isn't important in all scenarios.

Re:React is a fractal of bad design by ansgri on Wednesday March 08, 2023 @11:02AM (#35070660)
Marginal performance (i.e. 100 ms to 10 s per action, not multiple minute delays) is somewhat important to end users and matters only if they can switch easily. End users typically have little to no say in choosing the business software, especially after it's already bought.
Re:React is a fractal of bad design by CuriouslyC on Wednesday March 08, 2023 @10:07AM (#35069868)
Performance is usually a lower order concern than an app doing what you want. You can bail on a slow app because you're impatient all day long, but if it's the only way to do the thing you want to do, I 100% guarantee you're going to suck it up and use the app.
Re:React is a fractal of bad design by undefinedzero on Wednesday March 08, 2023 @07:13AM (#35068078)
React/competitor performance that people use to compare frameworks is about rendering performance. E.g. React takes 100ms longer to rerender 10,000 elements (random numbers for the example). In these situations the actual real world difference will be negligible.

Site performance is much more API based, and that’s the same regardless of frontend. React has more library solutions to optimize the UX though, as it’s the most mature and popular.

Re:React is a fractal of bad design by jameshart on Wednesday March 08, 2023 @07:54AM (#35068393)
People are tempted to use react in the animation frame render loop, and these comparisons often seem to assume that that is the level of performance we need to be targeting - enough to hold 60 fps. But react’s not a good fit there. Other animation techniques are better for a vast number of reasons.
Re:React is a fractal of bad design by kunley on Wednesday March 08, 2023 @10:52AM (#35070510)
Not exactly true about "performance is more API based". Everything adds up. 400ms here, 700 there. Websites can be slow even before api calls are triggered or on the middle of them, or while the results from api responses are presented.
Re:React is a fractal of bad design by undefinedzero on Wednesday March 08, 2023 @11:46AM (#35071283)
Rendering performance can definitely add up, but rarely do React websites render so many elements that you get to 700ms. Once you do, you can nearly always fix that with an performance optimizations iteration. I reckon that issue is just as likely in all frameworks, and less likely to be about React using 0.2ms (or something like that) longer per element to render before optimizations.
Re:React is a fractal of bad design by taylodl on Wednesday March 08, 2023 @11:44AM (#35071261)
> Site performance is much more API based

Exactly. And those API calls are going out over the network. The caller has to serialize the request into text, the API implementation has to deserialize the text into values that can be passed to a local implementation function and then the API implementation has to take the result and serialize it into the return. Finally the caller has to process the result.

That's the simple case. Things get even more involved when you start using HTTPS to secure the data in transit on the channel and using OAuth to secure the access to the API. What appears to be a simple API call turns into a lot of back-and-forths with multiple servers - with all the network latency that entails. Then developers complain their website is slow. Gee, I wonder why!

Re:React is a fractal of bad design by nine_k on Wednesday March 08, 2023 @08:39AM (#35068825)
The continued popularity of Slack and GitLab is an illustration that frontend performance alone is not the defining factor of success.
Re:React is a fractal of bad design by philwelch on Wednesday March 08, 2023 @10:49AM (#35070465)
Not to mention Jira.
Re:React is a fractal of bad design by amluto on Wednesday March 08, 2023 @09:25AM (#35069282)
Indeed, and I regularly watch other people give up on websites when they perform poorly.

And this isn’t just about 100 ms here or there. The frequency with which clicking a button takes seconds to have any observable effect is quite high. Coupled with modern UI trends where interactive elements aren’t clearly distinguished, sometimes users can’t tell a laggy button from a not-a-button.

I suspect a massive UX study bias here. Are people looking at telemetry to try to see whether users who completed some flow are happy? Those users (a) completed the flow, so they didn’t give up and (b) are likely enriched in those users who would use your site no matter what. The marginal users of poorly-functioning websites aren’t in the data set!

Re:React is a fractal of bad design by taco_emoji on Wednesday March 08, 2023 @10:13AM (#35069948)
Performance obviously matters, but only to the extent that everyone has a threshold for how much sluggishness they're willing to tolerate. For the majority of use cases, React is performant enough that devs don't have to go out of their way to optimize anything.
Re:React is a fractal of bad design by chiefalchemist on Wednesday March 08, 2023 @06:33AM (#35067769)
> Performance is very very rarely a contributor to a product success

You might as well say, having users is very very rarely a contributor to a product success. We're over two+ decades into the 21st Century and we're still pushing a 20th Century mindset?

Why Lord? Why?

Re:React is a fractal of bad design by SgtBastard on Wednesday March 08, 2023 @06:48AM (#35067878)
> You might as well say, having users is very very rarely a contributor to success.

These two things are not even remotely the same thing.

Having users is a path to monetisation but having a high performant app no one uses is not.

In fact, if you have users despite performance, it suggests you have a home run product that can be optimised for performance.

Again, you can’t optimise your way to user growth.

Re:React is a fractal of bad design by _heimdall on Wednesday March 08, 2023 @08:03AM (#35068489)
> Having users is a path to monetisation but having a high performant app no one uses is not.

These two things are also not the same. You start with "having users" and assume they're willing to pay and will stick around. You compare that to "having a high performance app no one uses" - explicitly limiting the scenario with an unrelated caveat that no one uses it.

A better comparison would look only at having users vs. a high performance app, which has too little information, or having users that aren't willing to pay vs. a high performance app that no one uses, which leave you in the same boat.

Re:React is a fractal of bad design by SgtBastard on Wednesday March 08, 2023 @08:20AM (#35068648)
Friend, your nitpicks here are of something I didn’t say.

I said explicitly “path to monetisation” not “assume they’ll pay and stick around”.

I hope you’ll agree that it’s easier to find a subset of users that will pay when your superset of all users is large vs a super(?)set of zero.

Re:React is a fractal of bad design by Illniyar on Wednesday March 08, 2023 @06:50AM (#35067898)
I might not as well say that. I in fact said something completely opposite - that users don't care about performance. Hence more features->more users.
Re:React is a fractal of bad design by holbrad on Wednesday March 08, 2023 @07:05AM (#35068017)
That's just simply not true though...

Do users explicitly care about how many milliseconds somethings takes? No definitely not

Do they care if the application feels slow ? Yes absolutely Do faster experiences subconsciously feel better ? Yes Does that subconscious feeling, impact metrics like sales or conversion ? Yes it does

Re:React is a fractal of bad design by kunley on Wednesday March 08, 2023 @11:03AM (#35070672)
All the (dozens and hundreds) milliseconds add up and the sum of it is perceived easily
Re:React is a fractal of bad design by fidgewidge on Wednesday March 08, 2023 @09:17AM (#35069196)
People pretty regularly say they buy iPhones because of the very smooth UI (performance), that they buy an ARM Mac because it's so much faster, etc. Google won partly because it was so fast.

So people do explicitly justify usage decisions with performance, all the time. Agreed that overall features win out but it's often the case that multiple products end up with broadly comparable sets of features and struggle to gain a persistent advantage there. Once you reach that point, perf can be a competitive advantage.

Re:React is a fractal of bad design by dham on Wednesday March 08, 2023 @07:54AM (#35068392)
> Performance is very very rarely a contributor to a product success. Users prefer more features over more performant app all the time (both directly when asked and indirectly by what products they choose).

Yet this is what all the JS people were saying in 2014 - 2015 when everything started to become SPA. They argued this is what the users want. That's been used to justify all this stuff for a very long time if you're on Twitter. When it gets traction within Twitter it leaks into orgs. It's the same argument that's used now for all the SSG,SSR,hydration,edge and whatever other buzzword.

The internet is miserable because of all these React sites. I know first hand because my wife has a Chromebook. Yet developers won't listen because they think 6x cpu slow down is good enough to test with on their $4000 Mac book pro.

If users really don't care that much about performance then why aren't we just rendering html and sending new html on every interaction. That's much easier to do, performs pretty well from a CPU/Memory standpoint.

We've taken on a lot of complexity over the years in defense of the users. The argument I go back to is what is "good enough" and the developers/product/design I've worked with don't know what this word means.

Re:React is a fractal of bad design by kunley on Wednesday March 08, 2023 @10:56AM (#35070588)
Absolutely agree. Thank you btw for bringing up some of the recent history. People forget so easily
Re:React is a fractal of bad design by DoesntMatter22 on Wednesday March 08, 2023 @03:08PM (#35074070)
Rerendering on the backend can actually be faster than doing AJAX calls because the BE has to send a lot more data than if it's server rendered.

I

Re:React is a fractal of bad design by pcthrowaway on Thursday March 09, 2023 @04:45PM (#35087181)
How is "server rendered" different form "rerendering on the backend"?
Re:React is a fractal of bad design by DoesntMatter22 on Friday March 10, 2023 @06:41PM (#35102931)
Rerendering should be Rendering, however they aren't different. They are the same.

Server rendering can carry less of a payload to the FE but you aren't sending unnecessary data.

Re:React is a fractal of bad design by agloe_dreams on Wednesday March 08, 2023 @09:39AM (#35069454)
> Framework performance is rarely a contributor to the speed of your rendering. It's most often a problem with how you structured your app. You can structure your app poorly in any framework.

This is absolutely true!

I would say that some frameworks make it easier to make mistakes. For example, Angular can be highly performant...but the automatic change detection kills performance. But wait, you can fix that! Just make your components use OnPush Change detection! ...which is not...the default? Why? In any Corporate app that displays complex UIs you absolutely need to be using it everywhere. but yet.

Personally, I think it is to make it easier for beginners who don't understand why their observables are not showing content on the page but it is still annoying to set it in every component or hunt it down. This is a small part of why we turned to using nx and generators with configurations that add it by default.

Re:React is a fractal of bad design by colin_jack on Wednesday March 08, 2023 @06:58PM (#35076471)
Not sure this is true. The following post has issues but I do find sense its argument that the result of what you are saying has been accelerated shrinkage of the mobile web as businesses increasingly use apps instead.

https://infrequently.org/2023/02/the-market-for-lemons/#shri...

Re:React is a fractal of bad design by tazjin on Wednesday March 08, 2023 @05:57AM (#35067525)
It's because these things are chosen across a perceived axis of "developer comfort/productivity", and UX (if it is considered at all) is an afterthought.
Re:React is a fractal of bad design by Izkata on Wednesday March 08, 2023 @06:10AM (#35067611)
> issues where a bigger update, such as switching from one panel to another, takes upwards of 200ms on a mid- or low-range machine.

We have a React+Redux search page where clicking checkboxes takes about that long to update the checkbox, on our good developer machines.

I won't rule out we did something wrong (this page was pretty early in our React understanding), but we've also not managed to fix it due to how much is on that page.

Re:React is a fractal of bad design by 0xblinq on Wednesday March 08, 2023 @04:46PM (#35075184)
I once worked for a pretty big and popular ticket selling company where you couldn’t type your credit card number too fast because it would miss numbers.

It was all redux’s magic and simplicity was making almost the entire thing rerender on every keystroke. Of course it was the developers fault, but it’s so easy to end in that situation that I blame the tools because to me when you shoot yourself in the foot that many times you start to ask yourself if what you have is a footgun.

Re:React is a fractal of bad design by timeon on Wednesday March 08, 2023 @09:19AM (#35069213)
Common sentiment here is that developer ergonomics is more valuable than user experience.
Re:React is a fractal of bad design by blahblah1234567 on Wednesday March 08, 2023 @11:25AM (#35070978)
"the modern webapp experience is so miserable for the average person."

Hyperbole. Web apps would not be so ubiquitous and popular for solving business problems if your claim was true.

Re:React is a fractal of bad design by happytoexplain on Wednesday March 08, 2023 @09:02PM (#35077509)
It's not hyperbole, IMO, and this format of rationale is faulty. There are many reasons why technologies and platforms become ubiquitous. Asserting that being ubiquitous means it can't also be miserable for the user is demonstrably false, with almost unlimited examples throughout software history.
Re:React is a fractal of bad design by blahblah1234567 on Thursday March 09, 2023 @08:16PM (#35089254)
Ok, I agree, Point taken.

However almost certainly ubuitity is one measure or factor in an item's usefulness. I'd also claim Usefulness inversely correlates with miserableness in the mind, but perhaps not in practice :P depending on how boring or miserable useful things are.

In general, I think usefulness overrides miserableness simply because the willingness to do useful things, despite miserableness, is clearly tolerated and performed all across human economies and societies through time. all just depends on definitions

Re:React is a fractal of bad design by phendrenad2 on Wednesday March 08, 2023 @11:48PM (#35078406)
No amount of speed will save you from a bad design.
Re:React is a fractal of bad design by azangru on Wednesday March 08, 2023 @04:15AM (#35066877)
> People tend to compare these frameworks on things that don't matter - often it's performance.

Performance people get offended when they hear things like that. I imagine what they will tell a person who says something like this is to:

- Look at the traces. Real metrics, on real devices that users have, not the one that developer has.

- Consider either large contentful paint (will likely be subpar with client-side rendering) or first input delay (will likely be subpar with server-side rendering). Consider, too, the new interaction-to-next-paint metric (rumoured to be bad with all js-heavy sites)

If these metrics look good, then great; carry on doing what you are doing. If they don't look so good, then, they would say, reflect on whether what you are building is losing the business money by driving users away.

Re:React is a fractal of bad design by bayesian_horse on Wednesday March 08, 2023 @04:19AM (#35066893)
"Performance" matters a lot less than many other things like collaborating with other people, or getting the DOM manipulation right.
Re:React is a fractal of bad design by simmerup on Wednesday March 08, 2023 @04:23AM (#35066919)
I read this sentiment as basically saying the users experience of the app matters less than the experience of the dev who works on it.
Re:React is a fractal of bad design by pas on Wednesday March 08, 2023 @04:43AM (#35067046)
My reading is the opposite. Basically all real end-to-end UX (actual performance included) depends on a collaborative effort.

Someone mentioned that React is slow, it might take 200ms to update many elements.... and? Unless someone is making a fast-paced interactive game of DOM elements, it doesn't matter. Structuring the UX in a user friendly way matters infinitely more.

Re:React is a fractal of bad design by thegeomaster on Wednesday March 08, 2023 @05:04AM (#35067176)
Structuring the UX in a user friendly way matters more, that doesn't mean random 200ms lags are OK. As you said, performance is UX too.

I hear normal, non-tech people with average hardware complain about "lagginess" of their machines all the time. And usually the only application they use is Chrome. They won't say that they had a 200ms lag when they clicked on a button, but the overall experience degrades when things are slow to respond. And when you sit that person in front of a good, optimized, snappy application, they will sing praise. Not particularly because of performance, but they will enjoy using it more, and they won't be able to explain exactly why.

You'd think that with the ridiculous amounts of money software engineers are paid to do what they do, they'd be able to swallow slightly more difficult collaboration and developer experience in order to deliver a more quality product. Forgive me for being harsh, and I don't mean this as directed to you (I don't know you), but our industry behaves like a bunch of babies.

Aside: if you're making an interactive game, you have 16ms to respond and render, not hundreds. In 16ms, modern games dispatch draw calls for millions of triangles, do AI, physics, netcode, level streaming and other bookeeping. Yet the teams there collaborate just fine.

Re:React is a fractal of bad design by pas on Wednesday March 08, 2023 @06:14AM (#35067645)
Random 200ms lag is different than showing a new panel full of elements.

I'm aware of those complaints. 95% is when people are using a thermal throttled old device, while the app in question is trying to smoothly animate a complete clusterfuck of a webpage (for bonus points it's usually in some god-awful WebView in an app).

It's not simply displaying new checkboxes, inputs, labels, buttons, it's multi-megabyte images with fancy CSS effects and so on.

> They won't say that they had a 200ms lag when they clicked on a button, but the overall experience degrades when things are slow to respond.

Of course, no questions there! But it's not because the "framework is not performant enough", it would be slow even in vanilla JS in 95+ % of situations.

> And when you sit that person in front of a good, optimized, snappy application, they will sing praise.

Yes. And it's because you say to the client/designer/productperson that hey, if you want snappiness even for the 99th percentile of your users (ranked by hardware), then let's test on that device, and let's forego that nice animation that you saw in that native app on your friend's iPhone 15 ÜberMaxPro.

And, not surprisingly, many of the aforementioned culprits will say "I want that shiny thing"

> but our industry behaves like a bunch of babies.

I don't think you're harsh at all! And I agree. Many IT workplaces went all-in with the infantilism. (Daycare for autist-savants! Colorful open-office with a playroom, maybe even a ball pit! You can't concentrate today? Don't worry, just play some table tennis, and try it again tomorrow! -- Contrast this with the endless office gray cubicle farms of the engineering departments ~50 years ago. Which is probably the other extreme of the spectrum. And I believe there's a healthy middle ground. Well maybe slacking off on HN is not exactly part of it.)

> Yet the teams there collaborate just fine.

The games industry is famously not in a "fine" place, I'd say :) But yes, of course, they have a clear target, and even if the process requires some blood sacrifice for the crunch times, it works, sometimes. Sometimes we get buggy things like Cyberpunk 2077, which was less-than-optimized for some target platforms.

Re:React is a fractal of bad design by bayesian_horse on Wednesday March 08, 2023 @05:13AM (#35067234)
React isn't defenseless in the performance department. If a naive implementation takes 200ms to update many elements, there's usually an approachable way to speed it up!
Re:React is a fractal of bad design by actualwitch on Wednesday March 08, 2023 @04:49AM (#35067084)
I will take an app that's a bit slow but renders consistently over an app that works faster but sometimes forgets to update parts of UI, every time.
Re:React is a fractal of bad design by josephg on Wednesday March 08, 2023 @10:24PM (#35077993)
Why would performance and correctness be in opposition to each other? Is chrome more buggy because its fast?
Re:React is a fractal of bad design by bayesian_horse on Wednesday March 08, 2023 @05:12AM (#35067228)
The performance "disadvantage" of react (compared to what? SolidJS? handcrafted JS? some WASM thing?) is so small a user won't notice it in most apps in most places even if you don't actually optimize things.

Then indeed, abstractions a team can agree on matter more. Getting state management right matters. Hiring people and getting them productive quickly matters. Those are strong points in favor of React and even Angular, to an increasing degree for Vue, Svelte and others.

Re:React is a fractal of bad design by azangru on Wednesday March 08, 2023 @05:27AM (#35067326)
> The performance "disadvantage" of react (compared to what? SolidJS? handcrafted JS? some WASM thing?) is so small a user won't notice it

How can you know this? The only scientific way to approach this question is with real-user metrics and analytics.

Re:React is a fractal of bad design by bayesian_horse on Wednesday March 08, 2023 @06:15AM (#35067658)
Experience from using React for many years tells me. Rarely have I needed to optimize anything related to react to make something visibly snappier, and most of the time it's not really React's fault.

And there are some benchmarks that show SolidJS and some other things are faster than React at specifically what React is doing (like dom manipulation/reconciliation etc).

And yes, I'm talking broad strokes!

Re:React is a fractal of bad design by grumple on Wednesday March 08, 2023 @09:14AM (#35069160)
If a page is taking too long to render or interact for regular web usage, it's almost certainly not because of React. Clearly there are extremely performant applications using it at the highest levels of scale and complexity (Facebook, Twitter, many others).
Re:React is a fractal of bad design by 0xblinq on Wednesday March 08, 2023 @05:01PM (#35075353)
Well, for the dev (for many of them) that’s how it is. As long as my tools are shiny, f*k the users.
Re:React is a fractal of bad design by wdb on Wednesday March 08, 2023 @06:02AM (#35067553)
Performance mostly matters depends on the target audience.

For example, if you have a React-based wrapper around some SAP Gateway calls to replace the standard SAP UI then the user doesn't have much say. Because of the perceived better UX. The users of the solution inside companies (think multinationals, larger government etc) your call agent that use the React-based SAP portal can't really say I am not going to use it. Hands are tight.

The only time performance really matters when you have paying customers

Re:React is a fractal of bad design by scns on Wednesday March 08, 2023 @04:10AM (#35066854)
SolidJS and Preact would be alternatives with JSX (and React compatibility in Preacts case). Worth checking out IMHO.
Re:React is a fractal of bad design by KyeRussell on Wednesday March 08, 2023 @04:29AM (#35066955)
Your dislike for ‘templates’ is much more a matter of personal preference than you’re letting on. Using language like “still using templates” makes me think that you don’t see any valid opposing view.

I do not like JSX. It’s not worth talking about why. It’s not an argument I want to have. But framing non-JSX approaches as objectively inferior is not in tune with the reality, being that this is something sensible people disagree on.

Re:React is a fractal of bad design by wokwokwok on Wednesday March 08, 2023 @05:10AM (#35067213)
> Templates are a no go for me

It’s pretty hard to get more “this is my opinion rather than a statement of objective fact” than this.

> I do not like JSX. It’s not worth talking about why. It’s not an argument I want to have.

Ok.

Um… well, it’s hard to have a discussion if you won’t talk about it…

…but, “code” templates allow autocomplete and type checking in a way that is an objectively distinctive superset of text templates.

It’s because they are code.

A template is (almost always) a weakly typed DSL. Written, ignoring all the history of language design… by a bunch of folk who don’t really know how to write programming languages. …and, they. Are. Bad. Not always… but often. …because writing a language is hard, and because (reason) you can’t ever use an existing template language. Oh no. This framework has to have its own unique one, because otherwise it doesn’t integrate tightly.

Do you like DSLs? Or do they just hide the complexity somewhere else? What if the DSL is bad, not orthogonal in its feature set, poorly implemented …but cute, and useful for a very very narrow use case.

Isn’t the main critique of react that it hides complexity by moving it from one place to another?

Don’t you think it’s a tiny bit ironic that all the other templates based languages with their custom template DSLs are doing the same thing?

Anyway; I think it’s fair to evaluate template languages as what they are: DSLs.

JavaScript is a better language than most template languages by a variety of metrics. Other languages are better than JavaScript, absolutely… but, never, have I seen a template language that is.

You can love declarative configuration all you want, but it’s very very difficult to argue that just because you can make a mess with procedural approaches that they are worse; because they are a strict superset of what’s possible using the declarative approach.

…so sure. I don’t but “JSX is easier to maintain”, but it’s distinctly superior in capability.

Re:React is a fractal of bad design by uranusjr on Wednesday March 08, 2023 @06:09AM (#35067606)
JavaScript is a better, but JSX is not JavaScript. It reuses many features from JavaScript, but you still need some sort of translation (compilation) step to make it useful. In this sense it is not really fundamentally different from any of those what you call template languages.

You can argue the fact JSX better integrates syntaxes from a proper programming language makes it better than other templating languages (and I’m not going to try persuading you otherwise), but the “JSX is better than template language because it is not one” stance you’re implying won’t help you win any arguments.

Re:React is a fractal of bad design by wokwokwok on Wednesday March 08, 2023 @07:29AM (#35068199)
It is javascript.

That is literally the difference between JSX and most other template languages. Look it up.

The template syntax is converted to literally code and evaluated. The <> are just syntax sugar. How did you imagine the inline code works? The in-line function declarations?

Did someone invent a mini-subset of JS as DSL and a custom runtime…? Don’t be ridiculous. They did not. JSX is literally a thin wrapper around actual code.

Re:React is a fractal of bad design by uranusjr on Wednesday March 08, 2023 @10:27AM (#35070144)
Template language being translated to code is nothing new and certainly not unique to JSX even only when you consider frontend JavaScript frameworks. Vue has been doing that ever since single-file component was a thing. You need to look up things, please.
Re:React is a fractal of bad design by prmph on Wednesday March 08, 2023 @08:28AM (#35068716)
Strongly agree. I just don’t get the hate for JSX.

JSX is objectively better than than the scores of custom DSL templating systems out there. If anything, I think JSX is not used and supported enough.

In the most general sense, JSX is just syntactic sugar for function composition. That it works well for html components is a side effect; it could certainly be used for more than that.

I

Re:React is a fractal of bad design by jmull on Wednesday March 08, 2023 @09:48AM (#35069573)
I have no idea why JSX wouldn't be considered a DSL template language?

I guess there are specific features you find compelling: it's typed, has good tooling for completions in your editor?

These exist in other template languages, and ones that transform more readily to HTML (which is the goal, don't forget).

Maybe you also value that it has a straight-forward, well-defined transformation to javascript?

That's OK, but since HTML is the goal, it doesn't seem right to optimize for an intermediate representation. To me it's a weakness of react that you have to work with HTML as javascript (which JSX mitigates fairly well, but is hardly ideal).

If you want to have it all, try Svelte.

Re:React is a fractal of bad design by prmph on Wednesday March 08, 2023 @10:03AM (#35069814)
Strongly agree. I just don’t get the hate for JSX.

JSX is objectively better than than the scores of templating systems out there. You get much more: type checking, use of JS for logic, and no need to learn yet custom arcane syntax. If anything, I think JSX is not used and supported enough.

In the general sense, JSX is just syntactic sugar for function composition. That it works well for html-style components is a side effect; it could certainly be used for more than that.

I wish is languages would support JSX natively, with absolutely to ties to React. Let me declare a function using JSX, e.g.,

    type Mode = “upper” | “lower”
    const capitalize = (str: string, mode: Mode) => mode === “upper”? str.toUpperCase() : str.toLowerCase()
    const join = (mode: Mode, …arr: string[]) => arr.map(str => <capitalize {{ str, mode }}/>).join()

    const joined = <join mode=“lower”>Bon Jovi /> // “bonjovi”
Re:React is a fractal of bad design by AlfeG on Wednesday March 08, 2023 @12:42PM (#35072144)
VsCode + Volar + Vue + TS do what is expected. Fully typed autocomplete experience, same as for Typescript. Zero problems.
Re:React is a fractal of bad design by OtomotO on Wednesday March 08, 2023 @04:44AM (#35067055)
> But I choose frameworks because of developer ergonomics.

I understand that sentiment, but it's part of the reason why computers today don't feel faster than in the past and why we waste sooooo incredibly much energy.

Re:React is a fractal of bad design by namaria on Wednesday March 08, 2023 @05:49AM (#35067457)
I don't think the sentiment in itself is harmful. I agree with the conclusion, but I believe the problem is, there is so much accidental complexity built into this space. Path dependency makes it hard to get rid of it, so rational developers and start ups end up contributing to the problem.
Re:React is a fractal of bad design by Ciantic on Wednesday March 08, 2023 @05:21AM (#35067279)
> When using React I usually just use MobX and everything just works.

MobX is signals library. In other words, you are already using the signals way of doing things if you mostly manage your state with MobX. I still use MobX as well if I think I can't use SolidJS.

SolidJs if you haven't looked has MobX-like tools built in, computed, autoruns and all the same tools, it triggers "renders" when one of the signals changes. In reality it doesn't have renders, because it's not based on VDOM, but it makes it look like it does.

However I like to keep my signal library separate, I would wish SolidJS had separate signals library I could use elsewhere as well.

Also SolidJS is big library and framework by now, it comes with risks if Ryan Carniato were ever to loose interest.

Re:React is a fractal of bad design by Illniyar on Wednesday March 08, 2023 @08:50AM (#35068940)
I haven't used SolidJS, so I can't comment much. But Signals have very good developer ergonomics. But from my experience other frameworks that use them come with drawbacks that I don't get with react. So MobX+React works better for me than - let's say vue.

From a brief look at their website, the downsides for using SolidJs for me seem pretty big. At the very first example, if you change it slightly you can see my problems:

  const CountingComponent = () => {
    const [count, setCount] = createSignal(0);
    const interval = setInterval(
      () => setCount(count => count + 1),
      1000
    );
    onCleanup(() => clearInterval(interval));
    if (count() % 2 == 0) {
      return <div>Even count value is {count()}</div>;
    }
    return <div>Odd count value is {count()}</div>;
  };
1. MobX let's me use objects without additional syntax (createSignal, count() instrad of just count)

2. The fact that the component does not rerender and that my code does not automatically change between even and odd text means I'll probably need to have an additional mental model for writing SolidJS components. Using React+MobX I just write as I would write any other function and it'll just work (There's magic involved, but manageable magic)

Re:React is a fractal of bad design by c-hendricks on Wednesday March 08, 2023 @03:55PM (#35074592)
There was a debate very recently between SolidJS and React communities over "internalized react-isms" like difference in behaviour you've pointed out. I think it's React that are doing the weird thing and calling your whole function again when one piece of data changes, but I do like having the ability to return early.
Re:React is a fractal of bad design by brnewd on Wednesday March 08, 2023 @05:33AM (#35067359)
TSX + MobX are the reason I'm happy to stay on the React train after a transition from AngularJs (1) to Vue 2 to React.
Re:React is a fractal of bad design by KronisLV on Wednesday March 08, 2023 @11:53AM (#35071413)
You might also be interested in checking out Vue 3 (with the Composition API) and Pinia, it's a pretty nice setup that feels similarly nice to how working with MobX is and even supports TypeScript.

Composition API: https://vuejs.org/guide/extras/composition-api-faq.html

Pinia (state management store): https://pinia.vuejs.org/

TypeScript support: https://vuejs.org/guide/typescript/composition-api.html

While I mostly stuck with JavaScript, personally I found the setup more convenient to use than working with hooks in React, and Pinia is also more like MobX than something like Redux, in that you don't have to work with too much accidental complexity for relatively simple setups. Sadly I don't have examples from that project, because it was proprietary, but the linked docs are nice.

Re:React is a fractal of bad design by brnewd on Wednesday March 15, 2023 @09:26AM (#35167997)
Thanks, I'm sure Vue 3 is a lot better than v2, but I deeply appreciate TSX for its refactoring and type checking capabilities. Vue does support TSX but it isn't a first class citizen.
Re:React is a fractal of bad design by red_admiral on Wednesday March 08, 2023 @05:48AM (#35067452)
> People tend to compare these frameworks on things that don't matter - often it's performance.

Performance on the end-user device, especially if you're just under/over certain thresholds like 1sec to switch "tabs" or whatever you're using, does matter. Especially if you're trying to get people to buy stuff.

I wish all developers had to routinely try their products on a low-end 2-year-old smartphone. That would take the discussion of whether performance matters to a more informed level.

Re:React is a fractal of bad design by sonicgear1 on Wednesday March 08, 2023 @06:10AM (#35067613)
Its is actually sad just looking from a hardware endpoint. A 2016 iPhone 7 has an advanced 5 nanometer CPU. That is really powerful when looking at the grand scheme of things. Yet most react "websites" will completely obliterate it and make the phone get blazingly hot. I do this for fun a lot when browsing the web: when a website makes my phone literally melt, I check its stack on my PC and sure enough it is almost always React paired up with Redux. These performance apologetics are sad.
Re:React is a fractal of bad design by molszanski on Wednesday March 08, 2023 @05:50AM (#35067472)
> When using React I usually just use MobX and everything just works.

Same. React as a UI library is great. React as a state manager (hooks) or a framework is (hooks or hooks+next) is not good. Writing and fusing business logic to a framework is always a bad idea

Re:React is a fractal of bad design by scotty79 on Wednesday March 08, 2023 @06:05AM (#35067566)
I don't see a problem with useEffect. It releses you from thinking about component lifecycle.

Conceptually the body of your component runs on every render. If you want to have some effect on your component not running in sync with that then you have useEffect to set it up and clean it up not when the component is mounted, unmoutend, rerendered ... just when the stuff you are interested in changes.

Re:React is a fractal of bad design by larsnystrom on Wednesday March 08, 2023 @06:10AM (#35067614)
I would say that useEffect is my favorite hook. It's neat. My least favorite hook would be useReducer. I've never used that one.
Re:React is a fractal of bad design by h9h9h9 on Wednesday March 08, 2023 @07:05AM (#35068016)
Lmao @ all the react devs coping.

I hope we go back to server rendered sites, with vainilla javascript sprinkled here and there and abandon monstrosities like React or Angular that shouldn't have existed in the first place.

Re:React is a fractal of bad design by kypro on Wednesday March 08, 2023 @07:12AM (#35068075)
> Templates are a no go for me. I use them for blogs or static websites, but applications are easier to make and maintain with actual javascript.

Could you expand on this. You assert that "applications" are easier to maintain with JS, but blogs are not?

Are you defining "application" here as something with dynamic and interactive content?

Also, why is it easier to "make and maintain"? I'm not necessarily disagreeing, just curious as to why you believe this.

Re:React is a fractal of bad design by Illniyar on Wednesday March 08, 2023 @08:23AM (#35068673)
The way I look at it - the majority of value with blogs and static website is content. Hence the majority of change is of content.

For apps the majority of value is functionality and that's where a lot of changes happen.

The main problem of maintenance happens where there is the most change - in JSX programming (I.E. functionality) is a first class citizen and it lends it easier to change. With templates content is much more of a first-class citizen.

Of course this is all in the margins, you can write blogs/static sites well in react and applications well in template-based languages. The tradeoffs are just a bit skewed in favor of each, and it mostly manifests when you don't have time to be disciplined about changes.

Re:React is a fractal of bad design by kypro on Thursday March 09, 2023 @11:42AM (#35083244)
Thanks for the explanation. Makes sense.
Re:React is a fractal of bad design by jmull on Wednesday March 08, 2023 @08:00AM (#35068457)
JSX is yet another template language, is it not?
Re:React is a fractal of bad design by Tade0 on Wednesday March 08, 2023 @08:31AM (#35068742)
> I use them for blogs or static websites, but applications are easier to make and maintain with actual javascript.

I dislike when JSX is framed as "just Javascript". It's really not - it's a templating language, just a very odd one - like its spiritual predecessor.

Personally I find JSX to be write-only and hard to reason about when looking at someone else's code.

Re:React is a fractal of bad design by Varqu on Wednesday March 08, 2023 @08:51AM (#35068947)
In my opinion, React was pretty much complete without the introduction of Hooks. Shifting from the previous Component-derived mental models to Hooks was a cause of many runtime issues in at least 2 companies that I worked for.

Unfortunately, React went from less-capable and more understandable to more-capable and less-understandable model. But yeah, that's just a newbie-coder take.

Re:React is a fractal of bad design by philliphaydon on Wednesday March 08, 2023 @09:19AM (#35069218)
There's 2 things that I hate about react.

1) JSX - It's terrible. Svelte, Vue, Riot... they all got it right. JSX, mixing a weird syntax of HTML and JS together is just inferior to HTML with additional markup.

2) I don't know why but every react project has crazy levels of abstraction. Everything is 15 layers deep and making any sort of change requires way too much effort to navigate 15 files and code reading to make the most mundane changes. Other libraries seem to suffer from this to a far smaller scale.

Re:React is a fractal of bad design by azangru on Wednesday March 08, 2023 @09:35AM (#35069408)
How is this example from vue docs:

<a v-on:click="doSomething">

preferable to the jsx version:

<a onClick={doSomething}>

or even this loop example from the vue docs:

    <li v-for="item in items">
      {{ item.message }}
    </li>
better than its jsx counterpart?

    items.map(item => (
      <li key={item.id}>{item.message}</li>
    ))
Re:React is a fractal of bad design by tekkk on Wednesday March 08, 2023 @09:42AM (#35069491)
For one you don't have to write an arbitrary key={item.id}. What if you don't have a unique ID? And even if you do, it's just busywork.

Then, what about conditionals? Or slots? Or classNames instead of classes? The saving grace of JSX is that it allows the creation of multiple small components inside a single file.

Re:React is a fractal of bad design by philliphaydon on Wednesday March 08, 2023 @09:49AM (#35069590)
> The saving grace of JSX is that it allows the creation of multiple small components inside a single file.

That's definitely not the saving grace of JSX. As I said, every react project is soooooooo overly abstracted into the tiniest little components. It's no wonder people /think/ react is slow.

Re:React is a fractal of bad design by Yiin on Wednesday March 08, 2023 @09:44AM (#35069514)
Doesn't change the point, but it's usually

    <a @click="doSomething">
Re:React is a fractal of bad design by philliphaydon on Wednesday March 08, 2023 @09:46AM (#35069551)
JSX forces you into small tiny components because anything of any decent size becomes unmanageable. There's way too much mixing of JS into the template.

Vue you can do

    <button :disabled="!isFormValid">Submit</button>
In React I've seen people do:

    if (!props.isFormValid) {
        return <button>Submit</button>;
    }

    return <button disabled="disabled">Submit</button>;
This is just an example, obviously you can write this better in React. My point is there's /always/ so much conditional markup like this in every react project I've come across or worked on.

Edit: I donno how to format code on here sorry. (oh figured it out, bunch of spaces)

Re:React is a fractal of bad design by MrJohz on Wednesday March 08, 2023 @10:16AM (#35069993)
> JSX forces you into small tiny components

I'm surprised you see that as a disadvantage, for me that's always the biggest advantage of JSX-style syntax! I don't want huge components that do everything, I want components to do as little as necessary to be actually useful. It's the same as if I were writing functions: keep them fairly small, make sure they're doing a specific thing usefully, and then compose them together like Lego bricks.

When I was doing more Vue work, this is one of the things that I struggled the most with, that splitting one component into two components required a load of boilerplate and a whole new file. (And that itself was a big improvement on Angular, which usually had multiple files doing different things, at least when I was last using it). This inevitably meant that I'd try and fit more and more stuff into a single component until it the pain of maintaining it was greater than the pain of splitting it. (At which point it would usually be a lot harder to extract the would-be child component than it needed to be, because I'd left it too long.)

I think the rest is mostly just syntax preferences. Like you say, you can write bad code in both cases, and I think a lot of it comes down to which matches better to your mental model if what HTML generation looks like. But being able to easily start a new component, just like starting a new function, is such an important benefit of JSX, for me at least.

Re:React is a fractal of bad design by edgyquant on Wednesday March 08, 2023 @10:30AM (#35070203)
I also love small and well thought components. But as an engineering lead and manager it’s a lot of effort wrangling devs to do so. They always start small and then overtime converge on multiple return statements full of huge amounts of inline JS.
Re:React is a fractal of bad design by MrJohz on Thursday March 09, 2023 @02:11AM (#35078949)
I've been enjoying SolidJS recently, and due to framework limitations, it is generally impossible to have multiple return statements, which I think helps a bit here. The signals stuff also lends itself really well to writing code that operates only on state, and then plugging it into a thinner, dumber DOM layer, so it's easier to compose pieces together. It's like hooks or the Vue composition API, but moreso? It's difficult to describe.

That said, SolidJS as a whole requires a completely different mental model of rendering, even if it does look superficially similar to React. It's also a much smaller ecosystem, with less documentation, so getting to grips with it is that much harder. Very rewarding, but probably not ideal for everyone right now.

Re:React is a fractal of bad design by azangru on Wednesday March 08, 2023 @11:43AM (#35071248)
> one of the things that I struggled the most with, that splitting one component into two components required a load of boilerplate and a whole new file.

Oh, I didn't know that about Vue. Eww!

Re:React is a fractal of bad design by hbrn on Wednesday March 08, 2023 @07:36PM (#35076800)
> I don't want huge components that do everything, I want components to do as little as necessary to be actually useful

Having lots of tiny components makes it harder to see the big picture.

Too big and too small are both bad, there's a balance you need to find. Components should be small enough to fit in your head, big enough to represent ideas. The difference is that it's natural for big components to be broken down into smaller ones when their size starts to cause pain. But nobody goes around merging smaller components into bigger ones to make them more readable. When your components are too tiny people just suffer through the pain and develop Stockholm syndrome.

> I'd try and fit more and more stuff into a single component until it the pain of maintaining it was greater than the pain of splitting it

I understand that it seems painful, but this is actually a great workflow: it forces the decision to split to be based on the real pain, not on your fantasies about future pain. Pain is a tool that helps you make good decisions. In that sense React is like Perl: easier to write, harder to reason about.

Re:React is a fractal of bad design by MrJohz on Thursday March 09, 2023 @01:57AM (#35078879)
To a certain extent, I agree that you also don't want overly small components, but it feels a lot like the debate about function size. Sure, you don't want to wrap every statement in its own function, you want functions that are big enough to actually do something useful, but as a rule of thumb, smaller is better than larger.

This isn't a theoretical concern either. Like I said, I've had this issue with Vue before, and component sizes just bloated to the point where many pages were just single, chaotically interwoven components with dozens of state variables that theoretically were never used by each other, but in practice tended to be shared accidentally or out of short term convenience. At which point all bets are off and every bug becomes an exercise in figuring out what's going on.

That's not to say that that's a Vue-specific problem, because I've also had that issue in other frameworks, including React. But far less often in React, because it's much easier to deal with the pain when it starts with a simple refactor, than dealing with it a year and several new features down the line when everything is tangled together like a headphone cord in your pocket.

Re:React is a fractal of bad design by azangru on Wednesday March 08, 2023 @09:53AM (#35069667)
> return <button disabled="disabled">Submit</button>;

In JSX, the "disabled" attribute is a boolean; so it would be just:

    return <button disabled={!isFormValid}>Submit</button>;
Re:React is a fractal of bad design by philliphaydon on Wednesday March 08, 2023 @09:57AM (#35069713)
> This is just an example, obviously you can write this better in React.

The issue is people write SO much conditional logic into their react templates. Not that disabled is boolean and can be written better.

Re:React is a fractal of bad design by mattwad on Wednesday March 08, 2023 @10:12AM (#35069921)
Trying to be fair here, but what about vue makes it less likely that you won't put the same conditional logic into your vue template? If it's just impossible, then you're saying the framework is more limited, which is fine but sometimes you want flexibility.

This seems to be a 'best practice' issue as well that can be avoided through PR review. My team has been putting logic more and more into local hook files to keep components clean.

Re:React is a fractal of bad design by philliphaydon on Wednesday March 08, 2023 @10:22AM (#35070084)
There's nothing inherently stopping people from writing clean react projects. But I've never seen one. But watching people fumble around trying to find where they need to make a change when things are so overly abstracted, and STILL try to justify that react is good, is baffling.

People break tables up into ~50+ files. It's crazy, and everyone does this, and its an absolute nightmare to maintain. Its 100% engrained into react culture that this is the right path forward.

React will never get better if people accept over abstraction as the right path forward.

Re:React is a fractal of bad design by hirvi74 on Wednesday March 08, 2023 @05:56PM (#35075935)
So, I have not used React more than a tutorial here and there. Same with any of the other SPA libraries.

I do not understand why everything needs to be a single page application. Sure, my current employer is behind the times in the technology we use, but honestly, we survive just fine with server side rendering and plain, ol'boring, vanilla Javascript and a little JQuery here and there.

Of course, some things we have written are difficult to maintain at times, but I doubt any other library would have really made it simpler (more of an issue with the requirements than the technology). Abstraction is simple, for us at least.

Re:React is a fractal of bad design by YPCrumble on Wednesday March 08, 2023 @10:08AM (#35069872)
Incredibly this is more readable than the Vue example given as a reason why Vue’s syntax is better!
Re:React is a fractal of bad design by edgyquant on Wednesday March 08, 2023 @10:31AM (#35070213)
The fact is that Vue enforces this and react doesn’t. So most devs do not write things this nicely
Re:React is a fractal of bad design by jaywalk on Wednesday March 08, 2023 @10:29AM (#35070177)
How so? I don't use Vue or React, but I don't see any real difference in readability between the two examples. They're both very straightforward.
Re:React is a fractal of bad design by adql on Wednesday March 08, 2023 @09:51AM (#35069607)
Both look like ye olde PHP code mixed with HTML tbh.
Re:React is a fractal of bad design by hirvi74 on Wednesday March 08, 2023 @05:59PM (#35075971)
"History does not repeat itself, but it often does rhyme" - Mark Twain (at least he is attributed with this saying).
Re:React is a fractal of bad design by azangru on Wednesday March 08, 2023 @09:51AM (#35069624)
For what it's worth, I like the syntax of Lit. There are a couple of magic symbols ("@" for method, "." for property); but otherwise, it's plain javascript.

The DOM output that Lit produces, peppered with magic comments, looks disgusting though :-(

Re:React is a fractal of bad design by minusf on Wednesday March 08, 2023 @10:32AM (#35070233)
i dont have a dog in this fight but JSX is PHP all over again with additional "creative solutions" where html and js keywords clash. but they both make html less readable in different measure for different people. please carry on with the arguments :}
Re:React is a fractal of bad design by postalrat on Wednesday March 08, 2023 @09:43AM (#35069503)
I see JSX as js with a macro to make the createElement calls a bit easier to read. It's not html at all.
Re:React is a fractal of bad design by another_kel on Wednesday March 08, 2023 @11:18AM (#35070865)
> JSX - It's terrible. Svelte, Vue, Riot... they all got it right. JSX, mixing a weird syntax of HTML and JS together is just inferior to HTML with additional markup

Hard disagree. Every time I work with Svelte\Vue I wish it had JSX, which is way superior to templating because:

- Creating sub components in the same file is super important. Going to a separate file, copying all the imports, writing emits, then going back and importing that file is too much hassle for a simple case where you have a carousel with cards. Refactoring is slow, components end up bloated.

- Passing down functions is more convenient than emits. For all the talk about how svelte is boilerplate free, it's equivalent of passing down a function and calling it is at least 5 extra lines of code.

- Passing down JSX elements is more convenient than slots. Every time I need to remember how to do named slots in vue\svelte I have to read documentation, while in React the mental model is obvious.

Re:React is a fractal of bad design by mock-possum on Wednesday March 08, 2023 @12:59PM (#35072380)
I can’t stand JSX either - it’s using JavaScript to render HTML templates, but it’s not valid JavaScript or HTML. I much prefer libraries like Lit that use tagged template literals for rendering component views - you write real code in the actual language the browser understands, no extra transpile step needed.
Re:React is a fractal of bad design by forgotusername6 on Wednesday March 08, 2023 @01:08PM (#35072516)
I absolutely love JSX. I came from a templating framework (marionette) and writing in JSX is amazing compared to that.
Re:React is a fractal of bad design by manmal on Wednesday March 08, 2023 @09:22AM (#35069256)
What’s the alternative to useEffect? I need it very often.
Re:React is a fractal of bad design by redbar0n on Thursday March 09, 2023 @08:27AM (#35080925)
you could try XState events, see David's "Goodbye useEffect" talk: https://www.youtube.com/watch?v=bGzanfKVFeU

or you could try the newfound craze: signals.

Re:React is a fractal of bad design by synergy20 on Wednesday March 08, 2023 @09:25AM (#35069284)
why is useEffect hook in particular that bad?

I played with Vue and svelte and now a firm React user, mainly due to its ecosystem, for most products the slowness of React does not play a major role at all for me.

Re:React is a fractal of bad design by afavour on Wednesday March 08, 2023 @09:32AM (#35069375)
My personal bugbear about pretty much all web frameworks discourse is universally stated things like:

> People tend to compare these frameworks on things that don't matter - often it's performance.

Performance matters in a lot of contexts. If you’re doing complex stuff performance matters. If you’re a public facing site depending in search traffic performance matters.

I’ve ended up disliking React simply because it’s become this one size fits all solution that 90% of web development goes through without it ever being necessary. There’s nothing wrong with React itself but it’s often applied badly.

Re:React is a fractal of bad design by adql on Wednesday March 08, 2023 @09:50AM (#35069593)
> People tend to compare these frameworks on things that don't matter - often it's performance.

I think I reflect the entirety of the user base of the internet when I say "fuck you" (not you in particular, just the trend of shitting on performance so we have apps running like it is 70's and tape drives on our gigahertz CPUs) here.

Re:React is a fractal of bad design by bakugo on Wednesday March 08, 2023 @10:07AM (#35069856)
> things that don't matter - often it's performance

You're a react guy, alright.

Re:React is a fractal of bad design by 0xblinq on Wednesday March 08, 2023 @03:01PM (#35074002)
This thinking is why most SPAs are utter shit for the end user. Most developers are so happy about their ergonomics and how cool their tools are and don’t care at all the application uses 200M on your browser and every key stroke takes 200ms to show in an input.

This also happens in the backend, but the difference is that the company país the price in the form of more infrastructure. But in the frontend is “free” so why care at all, right?

Re:React is a fractal of bad design by replygirl on Wednesday March 08, 2023 @03:48PM (#35074516)
that's a problem with the choice to go spa instead of ssr or static, not the choice to use a framework with productivity benefits. with every major meta-framework working seamlessly with the popular serverless hosts, it's a wonder anyone takes spa seriously in any performance-sensitive context
Re:React is a fractal of bad design by nailer on Thursday March 09, 2023 @04:37AM (#35079693)
Why is VDOM nice? None of the current frameworks use it and it’s generally considered slow and unnecessary.
Re:React is a fractal of bad design by pharmakom on Thursday March 09, 2023 @08:44AM (#35081066)
JSX is overrated. Why copy HTML, which is a pain to write? I much prefer regular old function calls. Or even s-expressions!