Settings

Theme

I'm Back, Ruby on Rails

blog.wildcat.io

48 points by sharms a year ago · 25 comments

Reader

xtracto a year ago

My company "inherited" some medium-sized Ruby on Rails codebase, and OMG what an abomination it is. Everything is "magic", everything is implicit and to find out what does what is horrible. I've done Ruby development in the past (production API with Sinatra) and it was OK, but I'll never start a "real life" project in Rails.

  • coffeecloud a year ago

    Read through the Rails docs and you'll learn all the "magic" is pretty easily explainable, mostly just predefined naming conventions and directory structures and a bunch of preconfigured gems.

    • tenacious_tuna a year ago

      I keep having this discussion with people, including coworkers (my current org is a rails shop).

      The thing that drives me nuts about Rails is that the conventions I learned everywhere else break down. There's no goto-definition that works in any sane way, I'm left `ag`ing through the codebase for `def whatever`. The amount of stuff I have to keep in my head to understand what any given object is doing (due to magic) is nuts and exhausting at times.

      The general impression I get from Rails and Ruby is a desire to be lexographically terse: fewer characters on screen per unit of business logic. On the one hand, you can fit a lot of code in view at once, which has it's benefits. On the other hand, you're sacrificing explicit data for that terseness, and you have to fall back to holding state in your head.

      Without a doubt, Rails is powerful, and there's a lot I've loved about working in the ecosystem, but there's very significant tradeoffs to doing things the Rails way.

      • coffeecloud a year ago

        Oh I found the goto-definition works pretty well in RubyMine.

        I would imagine goto-definition not working well to be more an issue with Ruby being a dynamically typed language and having metaprogramming features like define_method, not the framework. (FWIW I really dislike Ruby despite really liking Rails)

      • SkyPuncher a year ago

        I love Rails, but the magic is often too much for me.

        My many complaint is convention is soft. It has edge cases, divergent thinking, it has unplanned detours. This is especially true in a fast moving environment. I would much prefer that the magic wasn’t so opaque.

        For me, 99% Rails is by far my fastest productivity tool. However, that 1% of the time it just sucks.

  • ilrwbwrkhv a year ago

    Rails indeed has magic but the way Vercel has taken over React and the javascript ecosystem, it is really sad. The author makes some good points about the upselling and the javascript devs are so used to it that they pay the shipfast guy $299 to configure their project which makes the shipfast guy high 5 figure profits every month. Just for selling configuration. I kid you not.

  • aeze a year ago

    I'd argue there's nothing in RoR that's more 'magic' than "use client/server".

  • desireco42 a year ago

    You should inheris js or next project to feel the real pain :) nothing hurts as much...

    • throwaway48540 a year ago

      On the other hand, inheriting a proper TypeScript project is nothing but joy.

      • agentwiggles a year ago

        This strongly depends on your definition of proper. I'm currently working in great TS codebase, which was largely architected by one guy, who knows what he's doing and takes grug seriously. It's a really fun and productive project.

        The previous project I was on involved a "monorepo" using Nx (which sucks, imo), and a crazily frustrating zeal for abstracting every detail so that any given file contains 4 lines and finding out what anything fucking does involves opening 19 files and testing how many things my aging ex-stoner brain can hold in short term memory before the plates stop spinning and I catch myself wishing I dug ditches for a living, because at least you know when the ditch is done and there's no failed-upward idiot trying to deduplicate every detail of the digging.

        So, idk. It can definitely vary.

        • throwaway48540 a year ago

          Option A, if course. I feel you, Option B feels like a visit to Java land, not great at all.

  • sparker72678 a year ago

    Curious: what version of Rails was the codebase was running, and how long it had been around before it landed in your lap(s)?

  • ninetyninenine a year ago

    Good to start bad to inherit.

    I think the key is that ruby is good for kickstarting a business and getting it to a state where the business runs with high execution speed and minimal effort.

    Once the business is operational and stable then continuing from there is bad. Usually you will have to change the entire stack and of course from certain perspectives this can be seen as a lack of foresight.

    But if you chose to use another technology to start it could be that the speed of execution just wasn't fast enough and your business never reaches that island of stability because the technology just wasn't fast enough.

    • DoesntMatter22 a year ago

      Rails can be pretty much fine unless you hit massive proportions but then you are going to have problems in every language

UweSchmidt a year ago

When I learned about Rails a long time ago I thought the idea of MVC, scaffolding, creating the database, code and frontend that works, i.e. a basic application was genius, but hasn't quite caught on it seems.

Communities for RoR or Microsoft MVC could have created templates for all kinds of applications, and parameters with best-practice implementations of useful stuff like "jwt webtoken" could have been added and maybe implemented to work across different application templates?

Maybe there are good reasons why this is not feasible on a fundamental, technical level, but maybe that's just a path not travelled, as the open source spirit fizzled out and people tried for their own unicorn app.

  • jarsin a year ago

    In my experience I discovered Rails and Django because the generic do everything systems always run into some big roadblock that the client demands.

    At the end of the day every client/company has their own special requirements so going with a framework that speeds that process up without the pain of a generic system is where it is at.

    I cringe when I hear stories of new teams trying to move off Rails into something like Wordpress.

  • horsawlarway a year ago

    I mean... This is basically exactly what Microsoft tried.

    Template out your app, create the pieces through wizards, reduce developer need to interact with the underlying tech and make complicated choices in favor of best practice defaults.

    It was... mostly horrible (and I think this pain is where RoR is right now). The problem is that templates go stale awfully fast, tech changes, best practices change, good defaults change.

    Keeping a coherent codebase where the developers don't have an understanding of the choices that have been made is recipe for disaster. It always ends up mattering, because often best practices depend on top level objectives and aren't objectively correct, but rather trade-offs.

    RoR does what the author needs - it quickly bootstraps a tech company. The trade-off is that it sucks so hard in year 5.

    You get an easy start and a miserable middle. That's probably a trade most startups should make, but as a person who has to inherit that junk... Wow is it painful.

    • zanellato19 a year ago

      I have worked with 3 companies that had more than 5 years of Rails and I never had the pain people say it here. It continues to be easy to add features, grow the codebase and understand what is happening.

      I wonder how people don't understand the codebases they inherit to be honest.

      • horsawlarway a year ago

        If the team stays small - rails stays ok.

        I've twice now worked for companies that have experienced very dramatic growth. In both of those cases, rails became a huge liability.

        Case 1 - I was hire 7, we grew to ~350 engineers in 5 years.

        Case 2 - I was hire 50, we grew to ~700 engineers in 5 years.

        I'm not saying you can't also mess up that growth without Rails (trust, me - it's very challenging to grow at that speed and retain your sanity) but Rails makes it basically impossible.

        And as a counter - if you're small and stay small, basically any tech stack will work just fine, Rails is fine and so are most of the rest.

        Essentially - Rails heavily prioritizes single developer productivity at the expense of multi-team productivity.

bitwize a year ago

Fast and unbreakable eh? Sounds like a job for Go without a framework.

pjd7 a year ago

Where does one find out about all of these conventions for rails?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection