4 ms·
I agree that the cargo cult is real and abuse of the "SPA" paradigm has never been higher! But that is orthogonal to the tool. React does make front-end web de
by kingdomcome50 6y ago
I agree that the cargo cult is real and abuse of the "SPA" paradigm has never been higher! But that is orthogonal to the tool.
React does make front-end web dev not suck. It may not always be the right tool for end-users, but as a developer? C'mon. It's never been so ergonomic (and plain simple) to build a complex UI.
I googled stimulusjs[0] and you know what? From a development perspective it looks like it sucks compared to React. I'd rather just write vanilla JS than that hot garbage. Is the bundle smaller? Didn't bother to look, probably. Is it faster? Didn't bother to look, hopefully.
I get it! "Our job is to deliver value to the customer blah blah...". Engineering has costs as well. From training to velocity to, yeah I'll say it, developer happiness, you can't just ignore these costs. Working in a shitty, homegrown codebase using these niche libraries is a recipe for turnover.
On the other hand, if you are just whipping a some simple pages here and there that probably don't need to be looked at ever again... go for it! Your future self will cringe a little bit when you open up the source to change something simple years down the line (I know I have!), but at least those interactions are fleeting.
[0] I apologize for my crassness if you are somehow involved in the project.
- andrei_says_ 6y ago> On the other hand, if you are just whipping a some simple pages here and there that probably don't need to be looked at ever again... go for it! Most interactions on the web are simple. Tools like Gatsby use react to generate static websites. I’m sorry but that’s just insane. The problem I’m speaking of is having a great slick well balanced hammer (react) which is a pleasure to work with and using it to put nails into (SPA-ize) everything in sight. I’m not involved with stimulusjs or Hotwire apart from using them to create SPA-like experiences without much time, effort, or agony. Basecamp use Hotwire for their cross platform hey email client - maybe take a look, it’s a pretty nice app.
- kingdomcome50 6y agoYou should have included the very next sentence in my quote. There is a difference between using React and "SPA-izing" everything in sight. React is a library. It doesn't mandate an SPA as its use-case, and, frankly, I've had great success sprinkling React[0] into single pages that need that extra sparkle. Once you move beyond filtering a list or showing/hiding things, the pros quickly start to outweigh the cons. Could some of those pages be made a bit more efficient or have a smaller download? Probably. But nobody notices and I am able to iterate on them quickly because they follow the same general structure as the bigger applications I've built. To be clear, I'm not suggesting everyone use React for simple pages but criticizing the tool is a non-sequitur. You are kind of making my point above that all of this "modern JS is ruining the internet" criticism is being levied towards the wrong thing. Like you said, blame the bootcamps for churning out developers that know nothing else about how to develop a web page. Then blame industry for not training them the basics of their craft. [0] Or preact (https://preactjs.com/ https://preactjs.com/). Which is way smaller (3kb)! At this size, it's crazy to use anything else. How big is jQuery again? 20 times that size?
- andrei_says_ 6y agoI think we’re on the same page here and it’s a simple page with minimum added functionality via p/react or Vue or stimulusjs or even vanillajs and not an SPA which loads blog pages on top of each other.