It's not easy to understand why Rails was built like this, especially for beginners. I hope my little SVG drawings will help

· rails  · 2 min read

The Rails philosophy explained with drawings

It's not easy to understand why Rails was built like this, especially for beginners. I hope my little SVG drawings will help

In the NextJS era, there’s a lot of difficulty for junior developers to understand the MVC model, so plain old Rails, Laravel or Django may looks weird.

Rails itself has a special doctrine, that I would advise to read before to dive into the framework, because you may not understand the design choice along the way if you don’t deeply understand its philosophy.

Now here how I would draw it.

Rails values on deep integrated system, so your codebase may look like this :

  • gray zone = energy spend to write code
  • circle = one layer of your app (M, V or C for example)

As you can see, each circle is not completely independant of each other.

That means less code written at the end of the journey.

A cleaner architecture would be as follow :

  • gray zone = energy spend to write code
  • circle = one layer of your app (M, V or C for example)
  • green zone = energy spend to write boundaries code

Which leads to

  • more time spend on the gray zone
  • new time dedicated to write an maintain boundaries between zone

So is Rails 100% “clean” ? Maybe not for everybody.

Is Rails less energy spent? Less money spent? Less mental workload?

Yes.

Share:
Back to Blog

Related Posts

View All Posts »
Unpoly outclasses Hotwire

Unpoly outclasses Hotwire

Unpoly vs Hotwire... both are pushing the frontend in the same direction, but Unpoly made it with more simplicity. Here is why.

Rails 8 Hotwire, a tutorial

Rails 8 Hotwire, a tutorial

Rails 8 comes with Hotwire by default to handle frontend complexity. Here is a simple tutorial from scratch.

Ruby-on-Rails ERB vs HAML

Ruby-on-Rails ERB vs HAML

This is an opinionated article about ERB and HAML with Rails. Let's compare each other and pick a winner.