Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

react is immediate mode, and it doesn't have to refresh at xx fps; it only refreshes when a change in the data the gui is dependent on. (and the browser tends to refresh when there are input events)


This is the kind of thing that can easily devolve into a semantic argument. React presents an immediate mode like API but internally (both in the virtual DOM of React and within the actual DOM of the HTML document) the actual rendering path is very much retained mode.

The specific thread we are in isn't related to the benefits/drawbacks of API design but rather the performance implications of re-rendering the entire scene on every frame. As you mentioned, React doesn't re-render on every frame and therefore isn't really relevant to that discussion.


But render in the javascript library world means generating the html.

It has nothing to do with how the browser draws said html to the screen?


Rendering is a general term that can apply to many things. For example, in JavaScript there is `CanvasRenderingContext2D` [1] where "rendering" is about applying drawing commands to a canvas context.

So you are just proving my point that this kind of discussion devolves into a semantic argument. You want to define rendering one way. Someone else uses the term another way. It's the same problem with "immediate mode" vs "retained mode". People just throw the words around assuming that everyone uses them the same way.

In this way, no discussion is actually had. Just a bunch of people insisting that their personal definition of a term must be adhered to.

1. https://developer.mozilla.org/en-US/docs/Web/API/CanvasRende...


very plausibly the programmer you mentioned demanding that all uis be immediate mode was looking for the benefits/drawbacks of api design rather than the performance implications of re-rendering the entire scene on every frame; react shows one way they can be decoupled


They were talking about imgui, so no. Unless dear imgui is secretly an immediate mode API on top of a retained mode renderer?

Also, weren't you literally arguing in another thread that performance didn't matter? Some calculation about Raspberry Pis and percentages of cores? I'm starting to wonder how good faith of an argument is trying to be put forward here.


it seems like you're looking for an argument to win rather than new and exciting information to explore, and that's not what i'm here for. if i'm mistaken about something and i win the argument, what have i won? continuing to be mistaken?

in case you mislead other people, though, i want to point out that 'imgui' is often used to mean both 'immediate-mode guis' and 'dear imgui', which can be confusing




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

Search: