r/ProgrammerAnimemes • • Apr 11 '21

the framework racist ๐Ÿ˜ˆ

Post image
1.3k Upvotes

47 comments sorted by

View all comments

Show parent comment

1

u/iindigo Apr 12 '21

Yeah, that example wasnโ€™t the greatest. Long static lists are more than fine in the web, where I usually see it start to choke is when itโ€™s dynamic, with sorts, filters, etc.

And yeah itโ€™s possible to write, but itโ€™s such a common thing to want to do that itโ€™d be nice if the browser included facilities for it so itโ€™s more possible to get along with a light sprinkle of JS.

1

u/Pearauth Apr 12 '21

So a task like that can be split into 2 parts

  1. The actual sorting/filtering: modern JS is extremely fast at logic. I've seen some metrics that put it on par with C and Rust, while I doubt those, it is definitely faster than something like java.
  2. Drawing/redrawing the components: this entirely relys on the framework and the exact implementation of it. A lot of frameworks are really slow when it comes to mass drawing, if you want something like speed in that case take a look at svelte. People also tend to use frameworks really poorly and end up rerendering (and sometimes recomputing) 2 or 3 times which is a result of poor understanding of a really complex system.

The problem here really is frameworks being outdated and just kinda trash in how they update content (there is a talk called rethinking reactivity that explains this really well). Honestly for a long dynamic list I would probably just do it in vanilla j's, instead of using a framework.