Rails, 20+ year old grandpa that still brings smile to developers, unlike ReactJS, which is arrogant unruly teenager, which is no good for humanity.

There are two ways to solve a problem. One you solve it. The other you create an impression of solving it.

The video above explains the first way.

My downfall with ReactJS

I am working with one of the best clients I ever had in my life. In India, technicians and programmers get treated like shit, in such a country I feel blessed to work in a team where politics seems to be void. It’s very weird, I can’t believe. When there was the job interview, in the job description it was said I must know basics of ReactJS. I thought ‘how hard could it be?’. ReactJS and other JavaScript frameworks were written to make life of jQuery programmers better right? I was wrong. Fucking wrong.

I thought myself as a Rails programmer, but my company sees me as full stack programmer (wonder where the full stack ends, does it end in mining sand and making chips?). I didn’t like JavsScript and hence used jQuery, which wrapped JavaScript mess in a tolerable to use library. But in my job I found that ReactJS took JavaScript, added states to front end, made it worst. I found it was a huge framework designed to give a feeling that you are solving something, but gets you nowhere in limited amount of time and effort.

I took up Ruby and Ruby on Rails because I am very lazy guy. Rails lets me develop stuff for my client without a sweat (human politics and stupidity apart, there is no cure for that), so I can enjoy my life rest of the time. ReactJS made stuff super complex, and now being branded full sack developer, I was pushed into this abyss, hell!

Rails killed ReactJS in Rails 2.X

prototype.png Screenshot 2023-10-29 at 11-18-28 script.aculo.us - web 2.0 javascript.png
Prototype Scriptaculous

Rails killed ReactJS in Rails 2.X. We had Rails JavaScript or RJS. It neatly wrapped Ruby code over Prototype and Scriptaculous, and gave us a way to partially update pages. It was awesome, then Rails fell into the trap of jQuery, which sucked, but was better than ReactJs, Angular etc.

Right from the start Rails killed ReactJs. Yet people just took Rails as a buzzword, started to develop and muddle with it with JavaScript frameworks, made life worst for developers. Hotwire is just a rebranding / reincarnation of RJS. If RJS continued, it would have been 5X times more productive than ReactJS, hotwire is 10X more productive ReactJS. That’s the main difference. Both just replace part of a webpage. Nothing more.

People have no idea about Rails front end

Without knowing that Rails is a full front end framework, I saw projects after project fall into a trap saying that Rails is great for backend, and some JavaScript framework is great for frontend. All the while I saw how 37Signals effectively used Rails and made huge progress, but half-baked Indians muddled stuff, did politics and made progress so difficult.

People who are at the top of tech must use a new tech, understand it thoroughly, see if it does good, then adopt it only if it makes any productivity increase. But most code houses in India don’t do this basic research. Tech heads seem to talk, rather than toil with keyboard. Their decision is based on blogs, vlogs and hype.

Reasons Indian companies use React and avoid Rails

Another reason why Indian companies use ReectJS, Angular, Vue etc. is because they are service companies. They need to give impression to their clients that they are working hard so that they can bill a lot and prolong the project. That’s another reason why people choose non-productive frameworks that will drag stuff months than finishing things in days by using Rails recommended front end techniques which are super productive.

Hotwire, rebranding the old killer

All RJS did was to take a request, replace part of a page with HTML content, that’s what Hotwire does, but now its more developer friendly and much easier to do. RJS, and jQuery lost the propaganda war with ReactJS, just like Oracle’s SQL won the Database language battle, though it sucked. Hotwire merely make developers look back into Rails front end techniques, and people say its an innovation, in reality its not. I have been replacing parts of webpage using XMLHttpRequest() since the days I programmed internet explorer. But yes, Rails and Hotwire has made to do that stuff tremendously easier. That’s an innovation.

Burning ReactJS corpse with Morphing

I said Rails killed ReactJS even before BackboneJS was born, now it wants to burn the corpse of ReactJS so that people don’t even know ReactJS exists. Watch this video. If you like to be tracked by Google watch it here:

Look at this pull request https://github.com/hotwired/turbo/pull/1019.

With morphing, Rails is burning the corpses of ReactJS, Angular and Vue. All you need to do is to write server side code, Rails will look at the diff and applies it when the view is rendered. You get a single page application using Rails backend ways. I was blown away. This is what you need, I did have, and I am sure many of us would have had this idea, but now Rails people are bring it to reality. I thank them a lot for doing it. It’s still not innovation as they a have borrowed the idea, but they are committed to make developers happy. I respect that.

I am also thankful to DHH to keep Rails as a powerful framework where single developer like me can use it to launch a full-fledged SaaS product. DHH is delaying my professional switch to Clojure, I hate him for that.

How to escape from ReactJS and other JavaScript frameworks

If you are products based company and have given your project to some company that wants to bill you a lot, showing lot of work, you are screwed, I don’t know how your product will come out of evil peoples clutches. But if you have a team that obeys you, tell them yto ditch JavaScript framework and develop new features using Hotwire. This will make a quantum leap in productivity. Once the team has slack, tell them to port pages from ReactJS to Hotwire. Have a good tech person to audit their work so that no mishap happens.

htmx - liberating you from JavaScript hell

If you are not in a Rails project, if you are using Django, there is Turbo Django, else you can use HTMX, a library that I think was born out of frustration of using super low productive front end frameworks like ReactJS.

Yoda

Don’t forget the Yoda of programming that will bring bliss to development, its one of the latest incarnation of the force.
May the force be with you.

Watch the above video here if you want to move near to the force.