6

From Node to Ruby on Rails

 2 years ago
source link: https://nikodunk.com/a-node-js-developer-discovers-rails/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

From Node to Ruby on Rails

I learned to code in the Javascript stack [1] and am building a Javascript based product [2]. I never questioned this stack: many companies default to it, JS everywhere seems good, and the community is big. But for my new side project I decided to try Rails because despite some perception that Ruby on Rails is ‘over’, people in HN comments say it was somehow more enjoyable than the newer Node based stack. Having tried it I can say wow - coming from the current Javascript ecosystem makes discovering Rails a revelation.

Happiness

Building the web app in Rails took me 2 days – the same thing in Node would have taken 2 weeks. I’ve also included things I wouldn’t have attempted to build on Node/Express until I proved the idea out (editing a profile? Psht please - I’ll wait till someone requests that). People in the HN comments always accuse the Node ecosystem of making you re-invent the wheel for every project. But I thought that was just the way things were. Now I realize the truth to their words.

I feel like a productive founder building a pleasant product with god-like speed instead of a grim developer taking shortcuts to an MVP.

It turns out that while the uninitiated don’t consider it the newest technology, a happy subculture of entrepreneurs and corps keep Rails more than up to date. They keep adding amazing new features like an easy to use Websockets implementation. Or a reactive app technology called Hotwire. It’s like discovering a secret society that’s been hiding in plain sight.

Plumbing with JS frameworks

I decided to try Rails after writing boilerplate in Node for two hours with Express, Postgres, EJS, Knex, etc and having a simple ‘hello world’ to show for it.

I come from a business background, so the upside to learning development in the ‘current’ JS era is that there’s no way around learning some plumbing. React and Express are ‘un-opinionated’, which means they force you to pick all the components and connect them together yourself. You have to know a little about what you’re doing. I’ve learned all the basics because of this - things like raw SQL, ORMs, auth, testing, Websockets, migrations, how to structure a project. I’ve wired up CRUD and authentication 10 times for every new green field project I’ve worked on. Starting with Rails may not have given me this in-depth understanding.

The downside to understanding the plumbing is that I’ve thought a lot about plumbing instead of other stuff. Which is great for an engineer. But as a founder I’ve always found it hard to climb out of the plumbing, forget about it, and think about what the user wants. It’s hard to keep my eye on a wonderful product experience when I’m battling Knex or Redux.

Rails opens doors

But Rails magic is handling plumbing on my new project. What opportunities does this open up? I think there are mainly two:

Better computer science - I can focus more on learning useful patterns to create with the framework vs. how to set it up. Computer science is not plumbing.

Better business - Rails allows me to think about the product I’m developing - and build it at the speed of thought - instead of getting stuck in the weeds as I often do with a Node project. When I receive customer feedback i can move things effortlessly or scrap them mercilessly. I can even think like a user while I’m engineering it. This is the true magic of Rails for me so far: I can use both my left brain and my right brain. The high-level framework frees up enough headspace to think about what I’m building instead of how I’m building it. I can build things with such ease that I have headspace to think about the experience - so things don’t look like they were ‘designed by an engineer’ anymore.

Conclusion & Hypothesis

I wonder if I’d started building software a decade earlier and defaulted to Rails I would have focused more on the user experience and business case of my products and found more success with them. Maybe I could have focused more on why instead of how. I wonder if this helped some of my favorite companies from the 2005-2012 era succeed when they were building their initial products with Rails (Airbnb, GitHub, Shopify, Twitch, Flexport etc). Did Rails enable their founders to build more efficiently and not worry about plumbing? Did it allow them to focus on what users wanted instead of plumbing? Is that why they were so successful? Paul Graham mentions [3] Lisp was key in helping Viaweb outmaneuver their competitors due to its efficiency a generation before that. Or maybe high and low level frameworks make no difference: Maybe there’s just as many unsuccessful projects built with Rails, and the current Node-based products will be just as successful in a few years. Or maybe the internet market has matured so much since 2007 that it’s unfair to compare the cohorts.

Time will tell whether Rails is going to make me build better and more successful products by focusing on the right things. Either way I feel like I’ve struck on a magical treasure from the past and will not willingly give it up.


[1] - By JS everywhere I mean Express/React with Hugo for static which is a pretty common stack. In the following I’ll use Node interchangeably with Express and Hapi, the main two frameworks I’ve used. I’m aware that the equivalent framework to Express is probably Sinatra in the Ruby ecosystem, and I’m not fairly comparing the two. But as we know there is not true JS equivalent to Rails (no, it’s not Sails).

[2] - https://www.joinatmos.com runs on Node/React/Redux/React Native

[3] - http://paulgraham.com/avg.html


Recommend

  • 57
    • www.tuicool.com 6 years ago
    • Cache

    5 Best Ruby on Rails CMS platforms

    Having a development team working on your website is great. They can manage things, write impressive code, and make your site unique. Yet sometimes, it makes a project complicated. This happens especially when your websit...

  • 36
    • www.tuicool.com 6 years ago
    • Cache

    Ruby on Rails - send Emails with style

    Have you ever had to send emails from your Rails application? Probably your answer will be yes. Most of us dealt already at some point with the pain of sending HTML formatted emails using Ruby on Rails

  • 57
    • www.tuicool.com 6 years ago
    • Cache

    Node.js and Ruby on Rails: a comparison

    When a new project starts, there's always the need to decide which approach is better for its development. There are numerous possibilities out there and there's always those which are more popular and attractive upfront...

  • 35
    • www.tuicool.com 5 years ago
    • Cache

    Ruby on Rails 6.0 Beta 1 Deprecations

    About this time last year, I covered Ruby on Rails 5.2 Deprecations and got lots of appreciative feedback. With the upcoming next major upd...

  • 58

    In a rush?Skip to Rails e-commerce tutorial. When it comes to certain things in life, I'm a purist. A snob, even. Now if you don't have time—or simply don't care—to learn why I'm a purist, feel free to skip to...

  • 31
    • www.tuicool.com 5 years ago
    • Cache

    42 performance tips for Ruby on Rails

    This was originally posted on my blog Since Ruby on Rails is not the fastest web framework out there you sometimes need to improv...

  • 36
    • www.tuicool.com 5 years ago
    • Cache

    Inheritance on-the-fly with Ruby on Rails

    Inheritance on-the-fly wit...

  • 49
    • www.tuicool.com 5 years ago
    • Cache

    Add chat to your Ruby on Rails app

    Not all web apps need chat, but if you want to communicate with your customers, or you want them to communicate with each other, you’re going to run into this problem quickly. CometChat Pro is a fantastic alternative to r...

  • 49
    • www.jetbrains.com 5 years ago
    • Cache

    RubyMine: The Ruby on Rails IDE by JetBrains

    The Ruby and Rails IDE with first-class support for Ruby and Rails, JavaScript and CoffeeScript, ERB and HAML, CSS, Sass and Less, and more.

  • 14
    • semaphoreci.com 4 years ago
    • Cache

    Dockerizing a Ruby on Rails Application

    Introduction In this tutorial, you will learn how to dockerize a Ruby on Rails application. The application we’re going to build will make use of PostgreSQL, Redis, and Sidekiq. We’ll also be using Uni...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK