Brad Gessler Profile picture
Feb 28, 2023 17 tweets 7 min read Read on X
Sr Rails devs describe Rails as being the easiest and most productive way to build web apps. Meanwhile @joemasilotti @excid3 & others discuss how we’re losing a generation of Jr Rails devs because its daunting.

Can both be true?

Here’s my story on how Rails is losing Jrs.

📖👇
But first, this is NOT a list of complaints—it’s meant to open the eyes of Sr devs to the idea that Rails has strayed from its promise of “convention over configuration” and how other frameworks have caught up to Rails over the past decade.

✌️

Let’s get do it!
🧸 Assets: a tale of a menu that got too big

Do you use importmaps? js-bunding? css-bunlding? js-bundling *and* css-bundling? What if you need to switch from importmaps to js-bundling? What’s sprockets and propshaft?

There was a time when Rails had one asset pipeline: Sprockets Image
Sprockets had its issues, but one great thing about those times is we only had to learn one thing and wrestle with it to get it working.

I wrote about how to navigate the complexity of assets, but it’s still not enough for people new to Rails.

fly.io/ruby-dispatch/…
📒 Rails 7.x defaults to importmaps for JS assets, but there’s no mention of them in the official assets docs at guides.rubyonrails.org/asset_pipeline…

You have to be “in the know” to find the docs at github.com/rails/importma…, which is something a person new to Rails won’t know.
Finally, there was a time when a Rails gem plugin could be installed and assets would Just Work™. Today that’s no longer true since a plugin might work with Sprockets, but not jsbundling or importmaps.

Here’s one example of that confusion github.com/basecamp/local…
🔥 Hotwired

hotwired.dev doesn’t mention Rails. It’s trying to be framework agnostic, but could somebody please point me to a non-Rails framework that’s using Hotwired?

Its easy to see how a Jr might be confused by this and think they’re at the wrong place.
Even secondary pages like turbo.hotwired.dev don’t mention Rails. Only when I’m 3 levels deep at turbo.hotwired.dev/handbook/intro… do I see Rails, but all the examples are generic and don’t use Rails helpers.

The substantive Rails docs at github.com/hotwired/turbo… are a footnote. Image
☎️ WebSockets & Background Workers

Want to build a realtime web application in Rails? Deploying it to production is actually quite difficult. You’d have to know that Sidekiq is de facto background worker framework and AnyCable is the way to deploy WS.
There’s a point in your journey as a Rails dev where you have the epiphany that most production Rails applications use Redis for caching, WebSockets, and Background workers.

Calling it “Rails on Redis” wouldn’t be too far off, and its just as important as the DB.
I could keep going, but I think you get the idea that there’s a lot of stuff Sr devs take for granted that represents a learning curve for Jrs.

What can we do about it? 🤔

The obvious is “mentor a Jr” and I don’t like Tweeting about obvious stuff, so here’s some other ideas…
🫣 Look at other frameworks

Rails was a breath of fresh air when it was introduce, but most languages have caught up to Rails.

- phoenixframework.org
- laravel.com
- django-unicorn.com

Look at them and steal all their good ideas, esp the docs & dev UX.
🧸 Steer Rails back towards convention over configuration

If you maintain OSS projects, do your best to steer your project and the Rails community back towards conventions.

The more we standardize on how parts of Rails works, the bigger & better plugin ecosystem we’ll enjoy.
📕 Improve documentation

There’s lots of examples above for how documentation could be improved both in the core Rails docs and Hotwire docs.

The docs are ideally direct, opinionated, & tell devs “the one way” to do a thing instead of giving them a bunch of choices to navigate.
💡 Make the Dev UX more helpful

When a Rails project is booted up, here’s what people see: a “Rails” hood ornament with no indication of what to do next.

Compare that with Phoenix, which points people towards documentation and community.

Lots of potential here! ImageImage
👯‍♀️ Mentor a Jr

I said I wouldn’t say mentor a Jr, but it does help! If you do take on mentorship, it will be helpful for learning from them what parts of Rails are difficult to navigate both within the stack and within the docs.
To sum it up, Rails was ahead of its time when it shipped 10+ years ago.

Today we take it for granted because we know it so well and maybe haven’t closely followed other frameworks.

They’ve caught up, and its worth watching if we want to keep the Jr’s flowing into Rails.

✌️

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Brad Gessler

Brad Gessler Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @bradgessler

Nov 17, 2022
Got the prototype working!

The form object tracks which fields you’ve used, creates a permitted params hash, signs it, and stuffs it into a hidden `permitted_params` input field.

When the form is submitted, Rails verifies the params and stuffs them into `params.permit`
K time for some code!

First up? Here’s what a form can look like that’s implemented with phlex.fun once you get an ApplicationForm setup. Image
How do I call that form? From a controller! Check out the `new` action and the `form` method and you’ll see how I initialize the form.

Sidenote: you don’t need instance variables if you use phlex.fun for your views, which cleans things up nicely in controllers. Image
Read 7 tweets
Mar 11, 2020
Here we go... the VC world talking about “surving hard times” with advice given in lots of words that can be summed up as “be prudent with your money”

I went through YC in S08, known unofficially as “the worst YC class”. It’s when the “RIP good times” Sequoia deck went out.👇
What did we do with our company? We started to raise a small round, but half way through sent everybody their checks back because the amount of revenue we brought in from our customers that year was roughly equal. I called this Customer Capital funding.
The way we funded our work was by keeping an internal product backlog and putting a phone number on our website. If a customer called wanting something aligned with our backlog, we’d give them a quote, collect their money, and build it for them. It’s not rocket science.
Read 10 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(