DEV Community

Discussion on: How to not be a dinosaur.

Collapse
 
leastbad profile image
leastbad • Edited

Hi Johan,

I'm glad that you're finding your path through burnout and continual learning. No doubt that sharing your story will help others.

I do feel a strong (pee is burning level strong) need to suggest that what you're writing off as being old and not asking for help wasn't stoicism but potentially feeling imposter syndrome because your brain and gut are trying to tell you that somewhere along the road to this moment of React enlightenment, maybe everyone else went crazy and you stayed sane.

Specifically, I think that it's painfully regressive to have moved so much logic and responsibility to the client when you're inherently dealing with a stateless medium like the web. The "it would be funny if it wasn't so sad" amount of infrastructure and bikeshedding and constant tool churn that has gradually shifted from shocking to justifiable to "that's just how things have to be, now" is on par to watching Republicans do backflips to explain how Trump is a brilliant, honourable man who is definitely not a narcissist. :)

I spent a few months earlier this year learning and using React and React Native on some projects because my SO is using it at work and I wanted to be able to help. The whole time, coming from a Rails background, I had to constantly suppress feelings about how insanely difficult it seemed to be to accomplish very simple things. I recognized that my outbursts were not helping her, but I also held faith that surely all of these people who love React or Vue must have had some kind of light bulb moment where suddenly all of the pain of mastering all of these frameworks, packages, transpilers, reducers, build tools, shims, linters... that there must be a moment where everything clicked and made sense. That never happened. I firmly believe that there is now a massive sunk cost fallacy at work, especially among the younger members of our industry - many who have never worked with other tools and would be deeply terrified if the thing they've been assured is progress is fully debunked as a misstep. None of them want to hear that in 2004, one developer could teach themselves Rails (or PHP) and build a simple site from experiment to deployment in a day. The idea that all of these advances have dramatically upped the complexity for very little obvious benefit is something that only makes billing managers happy.

First of all: server-side rendered code is still the preferred development path today, despite the bubble of JS-for-everything that exists around sites like Dev.

Second, you can still embrace things like ES6 and webpack without even considering polluting your project with React. You think hooks is simple? Check out stimulusjs.org for simple. Stimulus is amazing! It's created by the same folks behind Rails, although you can use it with PHP (or ColdFusion). (BTW, have you noticed how similar CF templates are to Vue? I don't think that's an accident.)

Third, I managed to channel my sadness and frustration at the state of things into an incredible new approach to building applications that has no client state. It's called StimulusReflex and the basic idea is that when you load a page, it opens a websocket back to the server and captures events that happen in the browser. Those events trigger code paths on the server that update whatever data stores are applicable before re-generating the page and sending the changed bits back down to the client for lightning fast DOM updates. You can try out a bunch of examples here: expo.stimulusreflex.com/demos/tabular

The tabular example is compelling because there is literally zero custom JS required to implement this page, even though I'm sure you'll agree that it sure feels like it's running in React. (This is running on a free tier Heroku dyno; on a real site, round-trip updates are usually in the ~10-15ms range.)

This whole example required 115 LOC, between Ruby and HTML. It took... a very short amount of time. We want people to look at this and seriously question: if this is possible, then why do we need to maintain state on the client at all? If this is possible, can we keep our integrity while continuing to insist that React is a preferred path forward?

Collapse
 
dreamdealer profile image
Johan van Tongeren

Hi pjforde1978! First of all; thanks for reading my blog and taking the time to write such an extensive reply.

I can really see and appreciate your points about React and other frameworks, but this is not the big point I tried to make with this story.

If you replace React in my story with StimulusJS, your StimulusReflex or any other new technologies it still might be hard to catch up with something new after being "paused" for a while. This can feel overwhelming (and indeed make you feel like an imposter!) and hard to engage.

So my goal for this blog is to encourage people to keep learning, instead of promoting React.