3 ms·
Thanks to that page letting me see how many dozens of lines of code React needs to do the equivalent of const element = document.createElement("h1"); e
by yellowapple 8mo ago
Thanks to that page letting me see how many dozens of lines of code React needs to do the equivalent of
const element = document.createElement("h1");
element.innerHTML = "Hello";
element.setAttribute("title", "foo");
const container = document.getElementById("root");
container.appendChild(element);
I now have even less interest in ever touching a React codebase, and will henceforth consider the usage of React a code smell at best.
- madeofpalk 8mo agoAll of that is the JavaScript equivalent of <h1 title=foo>Hello</h1> I have even less interest in touching any of your codebases!
- yellowapple 8mo agoWell I'd hesitate to touch any of my codebases, too, so that's fair :)
- bossyTeacher 8mo agoStop touching my vanilla.js codebase, you naughty!
- htnthrow11220 8mo agoTo be fair, if all you need is to add elements to a child you don’t need React. Maybe nobody needs React, I’m not a fan. But a trivial stateless injection of DOM content is no argument at all.
- fragmede 8mo agoGiven the verbosity of Java's hello world vs Python's, you'd walk away with the conclusion that Java should never be used for anything, but that would be a mistake.
- ZeWaka 8mo agoClearly Java only belongs on things like credit cards and Minecraft /s
- mey 8mo agoWhy do you have to remind us that Java Card exists?
- oftenwrong 8mo ago#!/usr/bin/env java --source 25 void main() { IO.println("Hello, World!"); }
- t-writescode 8mo agoMany of Java’s hatred comes from old Java. The rest comes from Spring.
- Mogzol 8mo agoThe "magic" of React though is in its name, it's reactive. If all you're doing is creating static elements that don't need to react to changes in state then yeah, React is overkill. But when you have complex state and need all your elements to update as that state changes, then the benefits of React (or similar frameworks) become more apparent. Of course it's all still possible in vanilla JS, but it starts to become a mess of event handlers and DOM updates and the React equivalent starts to look a lot more appealing.
- llbbdd 8mo agoThis code only works if run in a browser composed of millions of lines of C++.
- lioeters 8mo agoI felt a great disturbance in the Force, as if millions of React devs cried out in terror and were suddenly silenced.
- llbbdd 8mo agoI love the term "React devs", it comes up on here a lot, and imagines a straw man group who really don't know how to build apps for the browser without React. It exists in tandem with the "frameworks for the web change every week" crowd, creating a vicious farcical enemy simultaneously confronted with a constant cycle of relearning while never being capable of learning at all.