DEV Community

Discussion on: Using Hotwire Turbo in Rails with legacy JavaScript

Collapse
 
leastbad profile image
leastbad

Yes, we agree. Phew! ;)

Seriously, though: where does the Ruby community's near-obsession with writing as little JS as possible come from? It's not a good look for a community that used to pride itself on how we were all polyglots.

Thread Thread
 
borama profile image
Matouš Borák

Yeah, I see what you mean. If I speak for myself, it's often just too much for me to grasp both languages deeply, the pace of JS progress is too big. It seems to me that JS used to be way simpler. And perhaps it's also just me growing older 🙂.

Thread Thread
 
iamnan profile image
Dave Gerton

One of the characteristics of ruby is that a few lines can encapsulate a lot of behavior. Core motivations like reflection and DRYness promotes this. It's not that rubyists (rails devs, more accurately) are avoiding JS specifically, they/we/I like to write as little any-language code as possible. It's definitely not something non-rubyists appreciate as much - I see referring to rail+pg+puma as the "magic stack" as an example - but if we measure success in time-to-market and maintainability, the fewer LOCs the better.

With regards to "not a good look," the ruby community has not been doing a very good marketing job and I think this is why Javascript and Python have overtaken it, not because we needed leftward assignment etc. But that's another topic.

Thread Thread
 
leastbad profile image
leastbad

You raise some good points, but you're not actually addressing mine, friend.

For example, I guarantee you that smart use of a Stimulus controller paired with your server-side updates will result in a lower LOC and a slicker end result. The values API and the MutationObserver in general are OP, to borrow a term from gamer-speak.

It's absolutely true that Ruby Central has radically failed compared to the Python Foundation when it comes to advocacy and marketing. RC seems to limit itself to running conferences, whereas PF sees itself rightly as a lobbyist - and I believe that this is precisely why, 15 years later, Python has such a huge lead in ML and data science, for example.

But you know what counts as bad marketing? Eschewing our "we are language polyglots" banner in favour of JavaScript bigotry. It's enough to make me wonder if Giles Bowkett wasn't on to something when he speculated that the Rails community's attitude toward JS might be rooted in subtle sexism.

gilesbowkett.blogspot.com/2016/10/...

It's a long post but it's highly worth revisiting. It's so strange to consider that it was written in 2016. Everything and nothing is different.