Rewrite It in Rails
269 points by WuxiFingerHold 5 days ago | 238 comments
  • WuxiFingerHold 5 days ago |
    Great real world article. Everybody should keep the bottom line "under their pillow":

    >> Interestingly, all of the things that used to annoy me about Ruby and Rails now annoy me much, much, much less. I have accepted that there is no perfect language or framework. You just have to know its strengths and weaknesses and deal with them.

    • bubblyworld 5 days ago |
      A little gem of an article, thanks for posting. It's nice to see a pragmatic take on rewriting for a change. Feels like a good primer to read before considering a rewrite myself haha
      • TomK32 5 days ago |
        Regarding rewrites, I'd love to have my code in such a shape that I could just copy over the business logic, maybe even put it into an independent library. The rest is just a user/api interface after all.
      • probablybetter 3 days ago |
        i saw that... (gem, ruby... hahhaha)
    • ozim 5 days ago |
      When people nag about frameworks I usually think that have their “perfect” world idea they don’t want compromise. Lots of times it is not having full understanding of the framework and why’s.

      But it is much more efficient working with the framework, knowing its limitations. Just spending time really understanding tools one work with.

    • dajonker 5 days ago |
      Yes this was indeed the most important thing for me to realize. I am now much happier, not constantly thinking "if only I had Rust enums!"
    • karmakaze 5 days ago |
      For context that came after trying this:

      > Meanwhile, I started building "version 2" of the application. I chose Rust as the language for the backend and SvelteKit for the frontend.

      Since it started out as Rails in v1, the post is to beware abandoning a framework that's working for you.

      • dajonker 5 days ago |
        Also try other languages for yourself and see if they are indeed as good as you think they might be. Or you might never realize that the grass isn't necessarily always greener on the other side. Unfortunately not everyone will have time to do that for longer than a couple of hours or days.
  • TomK32 5 days ago |
    I'm working with Rails for 17 years now, still love it and still prefer it even for the frontend. It give you all the options to separate your code without the head of your files becoming a unnecessary long list of `includes` like I see in the angular app I have to work on for a client. I don't see a disadvantage in splitting logic and markup for the frontend, it allows you to test the logic independently and normally when you hunt a bug you should know whether it's in the markup or the logic. Tracking down a bug thus becomes more easy.

    I've written my fair share of far too long ruby methods, 200 lines and more, but those are truly my fault. With a more granular unit test regime those can be prevented.

    • Etheryte 5 days ago |
      You know what else allows you to avoid having that long list of includes? Making everything global. I'm not sure if I see this as a benefit. Imports can take up a lot of space, yes, but they also make it explicit how everything ties together. If they're in your way, you can always have your IDE collapse them.
      • axelthegerman 5 days ago |
        > but they also make it explicit how everything ties together

        So does the autoloader used in Rails, it's called convention over configuration. There are only very few places it will look for the code (and in production everything gets preloaded too)

        So unless you want your class User actually in iMeanThisUser.ext or ../../../a/random/path/that/makes/no/sense/user.ext you shouldn't need explicit configuration

  • 0xblinq 5 days ago |
    Using Rust for a CRUD application is a terrible choice. Of course it won't work.

    It's like using Rails to write a database or a DNS server. You're just trying to use the wrong tool for the job.

    • JoshTriplett 5 days ago |
      It's not a terrible choice. It's not necessarily wildly better than alternatives, but it's not wildly worse, either.

      Among other reasons to consider it: if you want to run on a FaaS platorm or container setup, Rust has much faster cold start time and makes for smaller container sizes.

      Among reasons to not consider it: if you want to iterate rapidly by editing text and near-instantly hot-reloading your code, Rust web frameworks aren't really there yet. They will be one day, but they're not yet.

      • elcritch 5 days ago |
        > Among other reasons to consider it: if you want to run on a FaaS platorm or container setup, Rust has much faster cold start time and makes for smaller container sizes.

        Faster start time maybe, but I’m not sure about smaller containers. Rust is terrible with binary sizes in my admittedly limited experience.

        • oneshtein 5 days ago |
          I just compiled and checked:

          - sqlx binary: 200+ crates, 5.4Mb (after strip), 27 kb per crate on average.

          - zero2prod last example: 400+ crates, 14Mb (after strip), 35 kb per crate on average.

          Binary is statically linked, so Docker container is very small too.

          • elcritch 4 days ago |
            Exactly, 14Mb for a simple API server like zero2prod is rather large. That's with stripping, if you want the ability to debug and get pretty panics it'll be even larger.

            You can download a pre-compiled sqlite tools package includes four binary CLI tools in only 6.5 MB vs that one sqlx binary which is 5.4 MB. Of course they're not the same, but the general trend I've seen is that Rust is as large or often larger than bloated C++ projects.

            For example I worked with Rust on a Yocto project where you can't use Rust's stripping config because it breaks (broke?) the hashing Yocto does. A very small IoT API project ended up being 50+ MBs. It was larger than the rest of the entire Linux system. I've written IoT projects of similar complexity in Go and Nim which come in under 3-4MB with full debugging no stripping needed.

            • oneshtein 4 days ago |
              It's 14Mb with 400+ libraries included. `cargo bloat` shows that top function by size is from rustls (SSL support). For a container with a single binary, it's huge space saver. Moreover, I can easily optimize binary by size to 7.9Mb binary (20kb per crate on average).

              > because it breaks (broke?) the hashing Yocto does.

              It's problem with Yocto. In my case (few years ago, before the war), I just build RPM packages by my own build system and then install them on top of pure Yocto system. I optimize my binaries for embedded by size.

              In theory, debug symbols can be separated to a separate debuginfo rpm, and installed only when needed or mounted remotely from a host system. In practice, I just install the binary enhanced for debugging (with debugging and tracing features enabled) directly to Yocto device, then add test case to reproduce the problem on host, because I hate debuggers.

            • j-krieger 3 days ago |
              That is often because of static linking and the high chance that Rustls is linked in there somewhere
    • oneshtein 5 days ago |
      In my experience, CRUD applications in Rust are good: they are easy to write and test. :-/

      Why you think that Rust is a wrong choice for a simple or a complex CRUD application? Can you explain, please?

      • 0xblinq 4 days ago |
        Because it's not about the language. It's about the ecosystem, the tools, the libraries and the frameworks. There's no world where your barebones hyper performant Go/Rust/etc and its minimalistic routing library you might want to call a "web framework" can match Rails/Laravel/django/etc productivity wise.
    • eYrKEC2 5 days ago |
      If you don't like being paged at night, then Rust for CRUD apps is fantastic -- having worked with Python, c#, and nodejs backends, I'll take Rust backends every day of the week.
  • tinco 5 days ago |
    The reason NextJS and similar tech like SvelteKit are so popular amongst JS developers is that they alleviate the problem of Node.JS not having a great backend development experience. Building a backend in Typescript is like building it in C#, but without the advantages of a properly designed language. The experience of building a backend in Rails is miles away.

    Node.JS developers are starting to realize it's not just about having the ecosystem and the tooling, it's also about the framework being a holistic solution to building out your application. That's what NextJS and SvelteKit help with, and that's what Rails revolutionized back in 2006.

    • josephg 5 days ago |
      > Building a backend in Typescript is like building it in C#, but without the advantages of a properly designed language.

      I like typescript. In what way isn't it a "properly designed language", compared to C#?

      • creata 5 days ago |
        While it is thoughtfully designed, its type system has been designed under the severe constraint that it must be retrofittable on typical JavaScript code.
        • pjmlp 5 days ago |
          Which if it was easy, instead of someone like Anders Hejlsberg leading a language design team, anyone would do it.
          • creata 5 days ago |
            I didn't say it was easy. It obviously wasn't.
        • josephg 5 days ago |
          Your comment doesn’t advance the conversation in any way. It just restates the claim that typescript is worse in some unspecified way.

          Can you give any examples of ways in which those constraints have resulted in a worse language?

          • creata 5 days ago |
            > Your comment doesn’t advance the conversation in any way.

            That's oddly rude. I thought it might be useful to someone (not necessarily you) to bring up the fact that TypeScript is subject to a very different pressure than most other mainstream languages. That has obviously resulted in a very different type system, e.g., one with much better support for structural typing than most mainstream languages.

            > It just restates the claim that typescript is worse in some unspecified way.

            I did not "restate that claim". In fact, I was careful not to claim that TypeScript is "worse" than any other language, because that's a meaningless word without more context.

            > Can you give any examples of ways in which those constraints have resulted in a worse language?

            Again, saying that it's "worse" or "better" without context is meaningless.

      • jamil7 5 days ago |
        Well it’s bolted on for a start so introduces overhead from the get go. Its type system is also severely hamstrung and complicated by JS compatibility. It doesn’t really compare to Rust, Swift, OCaml etc.

        I do think it’s a huge improvement on JS though.

        • josephg 5 days ago |
          You say that, but its type system has some wonderful feature that those other languages lack. In what way is it hamstrung? It seems better than C# to me!

          For example, C# doesn’t support parameterised enums like typescript and rust do. Once you start using parameterised enums, you seriously can’t go back. It’s a killer feature.

          But even then, typescript goes further. All of these languages let me make a Color enum with red, green and blue variants. But as far as I know, only typescript will let me write a function which takes a strict subset of those variants. In typescript I can have a function that only accepts red or blue - and passing green (or something that might be green) would be a compilation error.

          Typescript also lets you make another type with a superset of another type’s variants. Eg type Foo = Color | “yellow”.

          In rust if I want to change a function’s signature to make one of the parameters optional, that’s a breaking api change since all existing callers need to wrap the parameter in Some(val). But in typescript, I just change the parameter’s type from T to T | null and everything works.

          Again, in what way is it hamstring? I’ll grant that JavaScript doesn’t have quite the performance of C# (though modern runtimes are pretty impressive!). But typescript itself seems great.

          • gardenhedge 5 days ago |
            Does TS have parameterised enums? Can you give an example?
            • MrJohz 5 days ago |
              It's not an explicit feature, but a combination of arbitrary records, sum types, and type narrowing:

                  type Animal =
                    | { species: "dog", name: string, catsChased: number }
                    | { species: "cat", name: string }
              
                  const animal: Animal = ...
              
                  // Available in all cases
                  console.log(animal.name)
              
                  if (animal.species === "dog") {
                    // Can access dog attrs here
                    console.log(animal.catsChased)
                  }
              
                  // ERROR: catsChased only exists for dog and not for cat
                  animal.catsChased
          • timeon 5 days ago |
            Can TS enums carry values like Option<T> ?
            • josephg 5 days ago |
              Sure! Though the normal way to write Option<T> is simply T | null.
          • neonsunset 5 days ago |
            > C# doesn’t support parameterised enums like typescript and rust do

            To be fair, you rarely miss them with pattern matching and records. In a similar vein to a sibling comment:

                var animal = ...
            
                Console.WriteLine(animal switch {
                    Animal.Dog(_, var cats) => $"Chased {cats} cats",
                    Animal.Cat or Animal.Bat => "No cats chased",
                    _ => "Unknown animal"
                });
            
                abstract record Animal(string Name) {
                    public record Dog(string Name, int CatsChased): Animal(Name);
                    public record Cat(string Name): Animal(Name);
                    public record Bat(string Name): Animal(Name);
                }
            
            There are many libraries to further enhance the experience, provide additional exhaustiveness analysis, etc.
      • wiseowise 5 days ago |
        In a way where you can’t admit that you like JS, because it’s not cool.
    • DeathArrow 5 days ago |
      If it comes to C# vs Typescript, I'll happily chose C#, at least for backend.

      For the FE I would prefer Typescript over Javascript.

      • rajamaka 5 days ago |
        Why? I don't really understand the point of declaring a preference if there's accompanying explanation.
      • pjmlp 5 days ago |
        I wish, unfortunately in the golden age of SaaS vendors, many seem to have Vercel deals in place, so Next.js with Typescript it is.
    • 0xblinq 5 days ago |
      > That's what NextJS and SvelteKit help with, and that's what Rails revolutionized back in 2006.

      Are you seriously comparing "being able to execute code on the backend" with Rails? Or Django? Or Laravel?

      There's no way in this world Next/Remix/etc are helping in any way to write code on the backend. Where's the support for database access? migrations? ORM? queues? scheduled jobs? validations? translations? authentication? authorization?

      The only thing Next.js is helping with is pushing people towards Vercel's platform, that's it.

  • michaelteter 5 days ago |
    Imagine if the author had tried Phoenix and Elixir with its amazing OTP foundation…
    • zem 5 days ago |
      the elixir ecosystem doesn't have the "library for anything you could possibly need" benefit that you find with rails (and probably django too)
      • flymaipie 5 days ago |
        As an elixir dev I am wondering what exactly you’re missing?
        • zem 5 days ago |
          most recently, maximum matching over a graph (edmond's blossom algorithm)
          • flymaipie 5 days ago |
            That actually sounds like a perfect use case for a Rust NIF in Elixir, since graph matching can be a performance issue
          • biorach 5 days ago |
            > maximum matching over a graph (edmond's blossom algorithm)

            Ruby/Rails has this?

      • josefrichter 5 days ago |
        This claim is greatly exaggerated
    • dajonker 5 days ago |
      Unfortunately, I did not! The reason for choosing Rust was mostly because of the lack of nulls and the way it handles errors. Basically the Option and Result types. And because you have so much low level control with a language that otherwise feels quite like a high level language.

      I did try Erlang around 2017-2018 and quite liked it. The Joe Armstrong book is one of my favorite programming books. Perhaps I'll have a look at Elixir if I ever need to build something new from scratch.

  • physicsguy 5 days ago |
    I’m the same with Django.

    I’ve found that perf issues were much more often caused by the DB queries than by Django itself.

    • sureglymop 5 days ago |
      I think almost always the DB query will take the longest but: I've seen too many engineers not even do basic optimizations such as creating indexes.

      Here's a list of easy/low hanging fruit optimizations that are often just forgotten: Creating indexes in the db, delegating more logic to the db than doing it in code (e.g. using pipelines in mongodb, partial indexes in postgres, etc.), turning on brotli/zstd compression for all or most requests, caching objects or requests in memory (e.g. with redis), setting appropriate cache control headers, frontend stuff such as not rendering thousands of objects as DOM nodes and instead using canvas (recently saw this in a map application).

      • jimnotgym 5 days ago |
        I have seen the opposite too, a db full of indexes that grew very large and was very slow on inserts! Understanding that an index is only useful on columns that you want to search might be a start!
      • VMtest 5 days ago |
        creating indexes will lock the tables if not mistaken, the problem about database is that many of us just don't study enough to make sense out of it
  • keybored 5 days ago |
    This is a nice enough article considered as an experience report. It’s tempting for me to focus too much on the title (was it a rewrite in an interesting sense? no, it was like going on a five-year trip across Asia and returning to your hometown to marry your high school sweetheart[1]).

    It doesn’t seem like the author learnt that much. They know Rails and Rails is good for making webapps? Makes sense.

    [1] For the author. The rest of the team didn’t know Rails. And there was no one on the team that knew that rewriting parts in “blazing fast”-lang would work.

    • dajonker 5 days ago |
      Yeah, it is maybe a bit of a clickbaity title, but I thought it was relevant enough. I tried Rewriting it in Rust and ended up not finding it worth the cost. There was some rewriting in Rails, but indeed, not very much.

      I did learn that things wouldn't necessarily be any better if I were to use language/framework X instead of Y.

      Edit: I guess I also learned that Rails does so much for you, so you can focus on building a good product. Just gotta make sure you use it as it wants to be used as much as possible.

  • hit8run 5 days ago |
    This article is kind of the story of my life… I launched a SaaS app written in Go in 2013 coming from Rails and I had to figure out everything on my own. Migrations, database layer, asset pipeline, deployment, validations, logging, payments and so many more things that rails just give you.
    • 0xblinq 5 days ago |
      You're comparing a systems oriented barebone low level programming language to a very (maybe the most) high level framework on top of a very (maybe the most) high level language.

      I'm not a fan of Go, but that's not the thing to blame here. Using Go for a "CRUD" application is a terrible decision from the get go.

      • neonsunset 5 days ago |
        Go is not a low level language. It does pretend to look like C but places at the other end of abstraction spectrum, even if it doesn’t seem that way.
      • hit8run 5 days ago |
        I’m not blaming and I fully knew what I was getting myself into. In the end it worked out and successfully launched etc. Just took me longer and had a learning curve that made me a better developer too. But had I wanted to just launch quickly from a business perspective Rails would have been the way as I already knew it. I still to this day like the simplicity and speed of Go. Like every year or two I come back to Go and try to get the dev experience for my own framework right with Rails in the back of my mind but it’s tough and more of a boilerplate than a framework.
    • Rzor 5 days ago |
      That experience has likely made you a more skilled developer, though.
      • juliogreff 5 days ago |
        I'm going through the same path right now, building my own product, and while I do indeed feel like it taught me tons, I don't want lessons, I want to get a business off the ground!
  • jeppester 5 days ago |
    We recently started testing AdonisJS as a TS alternative to rails.

    I'd recommend anyone who'd be interested in "Rails, but in TS" to give it a go.

    It feels much more similar to rails (or Laravel) than the most popular TS stacks, and also has "batteries included" instead of leaving you to decide on every part of your stack (or trust a template from a third party).

    • hanifc 5 days ago |
      I've been curious about AdonisJS, and I think I'll give it a try thanks to your comment.

      Recently, I've been fascinated by the "batteries included" back end frameworks of Rails, Laravel, and Django, but I've written TypeScript for pretty much my entire career, and it's just easier to keep it that way than to switch now.

      What are your thoughts so far in your testing? Could you compare it to any of those other frameworks I mentioned?

      • jeppester 5 days ago |
        I cannot compare it to Django and Laravel since I haven't used them for a few years.

        Rails is definitely more mature. It has a larger ecosystem and much more documentation. If you don't see any benefit from having types and sharing the programming language between the backend and frontend, then you are probably better off with rails.

        That being said AdonisJS has been working out surprisingly well thus far. I've found the documentation to cover pretty much anything we'd usually want an app to do, which is refreshing in the world of TS.

        You are also not locked in any way. While you can use the in-house ORM, validation library etc., it's easy to use something else if you prefer that.

        There are a few more rough edges than what you'd be used to from Rails, but nothing big so far and the source code is easy enough to get around, which I wouldn't say is always the case with rails. There's also a discord channel that seems fairly active and helpful.

    • gejose 3 days ago |
      Been meaning to try out AdonisJS and this is good to hear!

      For a recent personal project I went with NestJS but soon after discovered Adonis. I've actually been considering switching.

      • jeppester 2 days ago |
        We also tried out nest.js, but I wasn't really happy about it.

        To me it seemed more interested in being a smart dependency injection engine, and enforcing an - IMO not very JavaScripty - module pattern rather than being a useful tool.

        You can do everything you want, but you will have to make all the decisions yourself, and you will have to make everything play by nestjs's rules. And from my experience the seemingly comprehensive docs often don't get you very far.

        Follow the guide for Prisma and you won't be able to extend the Prisma client unless you refactor the service you've just made.

        Follow the guide for file upload and you will have a file in your controller, but very little information about how to store that file.

        That being said, I can see that lots of people really like nestjs, so maybe I'm just not getting it.

  • DeathArrow 5 days ago |
    Writing large web applications in Rust isn't going to happen fast. Large applications written in Rails won't run fast, might be ridden with bugs and might be hard to maintain and extend.

    Choosing something like Java, C# or Go might not sound sexy or cool, but with get the job done as fast as Rails while running almost as fast as Rust. That choice will also generally mean less bugs and a having a project that is easy to maintain and extend.

    • 0xblinq 5 days ago |
      You can't be seriously saying using "Go" (a low level systems language) will be as productive as using Rails (a very high level framework intended for CRUD applications). Despite how much you might hate Rails, that's like saying you'll build a blog faster with C++ than with WordPress.
      • 59nadir 5 days ago |
        Go is not a low-level systems language. Even using the more flexible modern definition of "low-level" it's not a low-level language. That's like saying OCaml is low-level; it's not even close.
        • yxhuvud 5 days ago |
          Go is not a low-level systems language, but it is a low-level web site builder language.
        • pjmlp 5 days ago |
          Great given that OCaml seems good enough to write hypervisors and unikernels.
      • jb1991 5 days ago |
        Go, a language with garbage collection and a compiler that does only an average job at optimizing machine code, is now considered low level?
        • pjmlp 5 days ago |
          It is as high level as C, unless you consider all non ISO extensions part of the language, in which case, any language can have similar extensions.

          There are more compilers by the way.

          • jb1991 5 days ago |
            Last I checked, C was not garbage collected.
            • pjmlp 5 days ago |
              So what?

              Here is a kernel writen in a GC enabled system programming language.

              https://people.inf.ethz.ch/wirth/ProjectOberon/Sources/Kerne...

              Or do you rather have one in Go?

              https://www.phoronix.com/news/TamaGo-Bare-Metal-Go-ARM

              • jb1991 5 days ago |
                OK, so it sounds like you are confirming an answer to my question, that Go, a language with garbage collection and a compiler (at least its most popular one) that does only an average job at optimizing machine code, is now considered low level.
                • pjmlp 5 days ago |
                  yeah, it has always been as low level as something like Cedar in Xerox PARC, and just as high level.

                  Or just as low level and high level as Interlisp-D at Xerox Parc.

                  As plenty of other languages.

                  If you want actual low level code, that is Assembly, and even that depends if the underlying CPU is a pure hardware implementation, or makes use of microcode and is for all practical purposes a mini-interpreter/JIT in hardware.

                  • jb1991 5 days ago |
                    That’s a fine analysis, but most people have a more generally accepted definition of what low-level means in a context of modern systems programming languages. I suppose you have provided an alternate definition, but it’s not really in the context of what most are thinking about in this arena.

                    It’s a bit like a podcast I listened to recently where someone suggested any language with a proper algebraic sum type can be considered a dynamic typed language in some ways. I mean, if you get philosophical about definitions and lean heavily mainly on historical context, it’s possible to say just about anything.

                    • pjmlp 5 days ago |
                      And some people call themselves engineers after a bootcamp, instead of actually earning a Software Engineering accreditation.

                      "C Is Not a Low-level Language Your computer is not a fast PDP-11"

                      https://queue.acm.org/detail.cfm?id=3212479

                      Naturally those people will also vouch that an article on the ACM, written by a one of the GCC Objective-C and GNUStep early contributors, and nowadays key researcher on CHERI project isn't something to take into consideration.

                      • probablybetter 3 days ago |
                        ... but, garbage collection, no direct memory management = impossible to write any firmware etc that needed to directly set bitflags and such. how could you call Go "low-level systems programming"?

                        Relative to Ruby, an interpreted dynamic language, sure, I will grant you that Go is lower-level, in the sense that you can compile a binary executable from it.

                        Go also happens to have web server primitives in their standard library and you COULD build a web app with only net/http...

                        • jb1991 3 days ago |
                          Moving the goal posts is a classic trait of HN behavior.
      • unit149 5 days ago |
        In terms of Go or C, even Rust which is one of the only of the two used in kernel development. Migrating is in line with the principles of the CRUD methodology, whether it takes place by means of a compiler or a junior developer parsing assembly line-by-line.
      • consteval 3 days ago |
        Go is absolutely not a low-level systems language. It has a GC. Even C++ isn't a low-level systems language: C++ is a high-level language.

        Seriously, how could someone describe a GC memory safe language as "low level"? Unless you mean the type system, which I admit is a bit more primitive than something like C++ or C#. But Go is definitely closer to Java/C# than C++.

        • neonsunset 3 days ago |
          C# stands out a bit as it provides first-class manual memory management APIs, zero-cost abstractions and tools to do RAII like many other systems programming languages do. It's quite unlike most other GC-based languages once you look at it closely.

          If anything, it allows you to go way more low-level than Go.

          • consteval 3 days ago |
            While true, I'd argue the way C# is used is closer to Java than C++, despite the tools it provides. Also I think Go allows manual memory management as well, although close to nobody uses it. In my head, there's a "sharp" divide between GC langs and non-GC langs. While the GC langs may provide some shallow hacks to get close to what lower-level langs can do, for those lower level langs that's all they can do. And typically it's not a 1-1.
            • neonsunset 2 days ago |
              The tools C# provides are far from "shallow hacks". Go does not provide "equivalent" ability to malloc and free, or write C structs with explicit layout. Does not have the same type of struct generics C# has ala Rust or C++ templates, it's not even close.

              Perception problems do not affect technical capability, and there exists a world of gamedev beyond enterprise engineering that treats C# appropriately.

    • loktarogar 5 days ago |
      > Large applications written in Rails won't run fast, might be ridden with bugs and might be hard to maintain and extend.

      With care, none of that is necessarily true. I think that's an overgeneralisation.

      I've worked with many large, bug free, stable and easy to modify rails apps. I've also worked with messy rats nests rails apps, and go apps, etc.

      It can be true that some languages/frameworks make it easier to get into that state, but all have a chance to make that a possibility, or other trade offs that make it difficult to build with for other reasons. With discipline you can make anything work.

      • t-writescode 5 days ago |
        I think the biggest difference for me is that when there's a rat's nest of a Rails application, refactoring it becomes the hell of type errors and writing tests that, frankly, a compiler would catch.

        And with sufficiently large applications, those issues really start to spread through the whole program - or can.

        addendum: I'd love to know why I'm getting downvoted here. I definitely speak from experience, here.

        • cageface 5 days ago |
          This is my experience as well. Rails makes it incredibly easy to get a web app off the ground but as it grows and adds more features and complex business logic it becomes much more difficult to maintain than a codebase with static type checking.
        • loktarogar 5 days ago |
          I guess my point was that, with discipline, it's not a foregone conclusion that a Rails app is going to be a rats nest. The lows can be pretty low for sure. But it's one of the tradeoffs for the framework and one that can be mitigated with thought and effort.
    • n_ary 5 days ago |
      > Large applications written in Rails won't run fast, might be ridden with bugs and might be hard to maintain and extend.

      I have never used BaseCamp, but I believe their products are well written and decent, hence with adequate care, good architecture and maintenance, it should be possible.

    • PaulRobinson 5 days ago |
      You can write large applications in Rails that run fast, have low bug counts and are not hard to maintain or extend. There are many examples in the wild.

      Rails is quicker to build in than Java, C# or Go for most functionality needed in most web applications for similar skilled developers. In my experience, up to 3x quicker.

      I’ve worked on large monoliths and SOAs, and worked alongside Java teams. I even introduced Go to a Rails shop because I believed what you did.

      Turns out the real problems were MVC isn’t right for everything, and we weren’t name-spacing with enough rigour. Fix those in small and targeted areas, and Rails is just fine.

      • jkman 5 days ago |
        As a dev that hasn't touched Ruby in his time yet, could you expand on the productivity differences you've seen between Java/C# and ruby devs? I totally buy that a language like ruby can be more productive, but a 3x difference is wild. Have you found that RoR is really just that much more productive than say, Spring or Asp.NET?
        • cloverich 5 days ago |
          (Ruby -> Rails) As one that switched into Rails after a decade of web dev, IME its the batteries included nature. You can't compare Rails to Go or Typescript. You compare Rails to language + all the standard libraries people use. The trick with Rails is _most_ of those choices are baked into the framework, so e.g. 25 rails dev's will know _mostly_ the same exact set of libraries walking in the door.

          Personally I absolutely hate it, and regret taking a job in it. Its the first language ecosystem that made me realize yes, apparently I really do care a lot about the language(s) I work in (had prior exp in php, python, java, Go, and Typescript, and enjoyed most of them). But I wouldn't knock anyone for using it, especially if they can hire experienced teammates in it or generally find the approach (typeless, convention over configuration) appealing. It's definitely a great choice for a web product if the team(s) will stick with it over time. I'd happily manage a team using it at this point, I just don't want to write it anymore.

  • neonsunset 5 days ago |
    Please don’t.

    You pay 100x for each line of code and get nothing in return over ASP.NET Core or Vert.X. Pick any fast compiled language you like, don’t contribute to global warming.

    • bowsamic 5 days ago |
      “Don’t contribute to global warming” is the silliest argument for perf bc you can use it to dismiss basically any human leisure activity. Why is it okay to use a computer to play video games but not make the perf tradeoff with Ruby?
      • neonsunset 5 days ago |
        Because there is no trade off. Rails does not offer anything over picking Kotlin/C#/F# or even Go offerings. The “productivity” is a little excuse used to hand wave away the criticism of absolutely unacceptable state of Ruby performance in the year of 2024 and all the other problems that it has.
        • bowsamic 5 days ago |
          The whole article is about how there is a tradeoff, sorry they didn’t investigate your preferred technology but you can’t expect them to try forever. Even if they had tho, are those really “batteries included” offerings like Rails?
        • WA 5 days ago |
          What do you mean? Rails seems to come with authentication, session management, cookie management, an ORM, extensive logging capabilities and a bunch of other things. Go and Kotlin are languages, not frameworks, and they certainly don't include these things. So what are you comparing exactly?
          • neonsunset 5 days ago |
            My initial comment lists two great options that make choosing Rails an unconditionally short-sighted decision.
            • wiseowise 5 days ago |
              ASP.NET - maybe, but you’ve got to be kidding if you suggest Vert.x to be a replacement for RoR. They operate on completely different levels of abstraction (even ignoring nightmare of Reactive code you have to write using Vert.x).
              • p2detar 5 days ago |
                Not a nightmare at all, if you know what you’re doing. There’s a learning curve indeed, I’ll give you that.
              • neonsunset 5 days ago |
                Maybe my impression on Vert.X was misplaced. Trying it out left me off with "Oh, so kind of like ANC minimal API with Rx.NET but faster". I should revisit this, thank you.

                JVM ecosystem has other great frameworks like Active-J and Ktor. My main point is, unless that's what you're most productive in, RoR is a really poor choice for both small and large codebases and there are plenty of options that completely eliminate the classes of issues you would otherwise have to spend the time on.

                Sure, I like using C# (and recently F#) a lot but it wouldn't kill me if I had to use Kotlin/Java/Go/Swift instead. All these have understandable tradeoffs and merits to them. On the other hand, my experience of interacting with advocates of Python, Ruby and Erlang is incredibly poor - it's impossible to have a technical conversation and it seems that their communities live in a bubble of belief that using interpreted junk comes with magical productivity advantages inaccessible to expressive modern compiled languages with rich type systems and excelled back-end frameworks/libraries.

        • robertjpayne 5 days ago |
          Ruby really isn't that slow -- even so most of its "performance" problems are due to idling waiting for I/O not actual code.

          If you care about power consumption of computing you need to be looking at current AI and crypto currencies consumption like Bitcoin…

        • dajonker 5 days ago |
          Sure, I'll bite. Are you a Rails developer maintaining an app that actually has massive performance issues?

          Luckily, our Rails app is very snappy and runs on hardware equivalent to an average 4 year old laptop. No issues with performance that I can't fix. No exorbitant power usage.

          Also, as a niche business app, it will never have to scale as much as GitHub does.

      • wiseowise 5 days ago |
        You can argue that game devs also have moral obligation to mitigate impact of their games by better optimizing them.
        • bowsamic 5 days ago |
          Okay but where does it stop? Surely any amount of energy wasted on entertainment is wrong.

          Why is it okay to waste energy for entertainment but not waste energy for development experience and efficiency?

    • duckmysick 5 days ago |
      Could you explain your comment more? The way I understand it is:

      - I have two servers with the exact same hardware - one runs a Ruby on Rails web app - the other runs a Vert.X web app - both apps have similar features to the end users - if I run both of them for a month, the server running the Ruby on Rails app will consume hundred times more energy in kWh compared to the server with the Vert.X app - another way to look at it, to serve the same number of visitors, I would need hundred servers running a Ruby on Rails apps and one server running a Vert.X app

      Is that correct?

      It hasn't been my experience when I measured the long-term consumptions with energy meters in real-life scenarios. How did you arrive at your number?

      By comparison, going from resistive heating to a heat pump is a 2.5x-4x jump in efficiency. 100x gains would be nothing short of spectacular.

      I noticed the best energy savings when switching to Arm CPUs, but that's a separate topic.

    • downrightmike 3 days ago |
      Billionaires create more CO2 in 90 minutes, than normal people create in their lives. This whole carbon footprint is BS marketing from fossil fuel monopolies.
  • BoorishBears 5 days ago |
    I want to try Rails but I can't downgrade away from static typing for my personal projects. I typically want to spin them out quickly and not worry about writing tests: static typing adds way too much value in that scenario.

    I looked into Ruby's static typing attempts but the picture painted was grim.

    • Alifatisk 5 days ago |
      Sadly, that is the reality of Ruby, no excuses. Introducing static typing to Ruby is a huge task considering the way the language is designed.

      The attempts you've seen is probably Sorbet (sorbet-runtime) and RBS. In my opinion, RBS would be an option for me if they didn't force me to work in a separate file just for type declarations.

      There is one gem that is interesting, it reminds me a lot of jsdoc. It's called rbs-inline https://rubygems.org/gems/rbs-inline

      • xiphias2 5 days ago |
        It's not really sad. Optional static typing has advantages and disadvantages and there are enough dynamic programming languages that have it (JS, Python for example).

        I think the problem with static typing is that it changes the whole ecosystem too much to be considered just optional, even if it's backwards compatible (like in Python).

        Just as an example I'm using lambdas in fasthtml in Python that don't allow type specifications for adding routes and fasthtml keeps on spitting out warnings that I didn't specify the type and doesn't handle variables in lambda functions correctly.

        • Alifatisk 5 days ago |
          > Just as an example I'm using lambdas in fasthtml in Python that don't allow type specifications for adding routes and fasthtml keeps on spitting out warnings that I didn't specify the type and doesn't handle variables in lambda functions correctly.

          That's a very interesting yet valid downside I didn't think of

      • chucke 5 days ago |
        FYI rbs-inline is maintained by the rbs creator, and will eventually be merged into mainline, once the inline syntax alternatives are set in stone. All to address the main complaint you mentioned above.
        • Alifatisk 5 days ago |
          I am so glad you mentioned this, this got me excited!
    • cloverich 5 days ago |
      IMHO if you like static types, I suspect you won't like Rails. Its the intentional opposite of them in many ways. I made the swap you're contemplating with similar reservations and absolutely regret it. Rails is definitely great but IME it appeals to a particular kind of developer, in the same way hard-core functional languages, strict types, or e.g. Go's' flavor of error handling each appeal to other groups. I've found those higher level patterns extend beyond mere fashion and more into some kind of persistent style preferences that's not easily changed. I dipped into the functional world and did not like it. Now I feel similarly about Rails. There are just so many times I want to offload my mental model into types, and that concept doesn't really exist in Rails. And it doesn't seem to bother most of the folks I work with, and I suspect it has more to do with how my brain works under the hood compared to theirs.

      I definitely think Rails can be worth trying, but if you're the type to be evaluating types from the outset, I'd wager that's the exact kind of person that won't like what they get into.

  • nbittich 5 days ago |
    Rust is a language built by extremely smart people, unfortunately their focus is more on type theory and sparing few allocations than building something useful and coherent for blue collar devs like me. When I read a blog post on rust, I literally don't understand half of it, although I'm working with rust since 2020.
    • Expurple 5 days ago |
      Could you share your examples of incoherence in Rust? I actually find it a small, well-designed and very coherent language. At least, when compared to huge mainstream languages. E.g., traits cover the use cases of both "abstract classes" and "concepts" in C++, or both "abstract classes" and "protocols" in Python. And there are no inconsistencies regarding using exceptions or returning errors by value (panics exist, but they are used as assertions). There's no separate ternary operator, which is redundant when you have an if-else expression.
      • nbittich 5 days ago |
        Async vs non async code. It's basically two different languages imho. generics are also a big pain to work with, specially along with lifetimes. I have fun working with rust now that I am good enough at it, but I kept my objectivity in the process of learning it.
      • hu3 5 days ago |
        > Could you share your examples of incoherence in Rust?

        just a nit.

        I think they used a narrow definition of coherent, for blue collars, which in web often imply mundane CRUD and agency apps.

        I wouldn't expand the discussion to a brother definition about a general incoherency in the language. And certainty wouldn't bring comparisons to C++ when replying to their message.

        • timkq 3 days ago |
          I guess by "blue collar devs" (as you said, mundane CRUD etc.) they mean devs that will quickly get replaced by AI.
      • j-krieger 3 days ago |
        Anything by withoutboats, really.
      • IshKebab 3 days ago |
        I think async/sync is a big example as someone else mentioned.

        I'd also say the macro systems. Macro by example is a totally new (and let's be honest, awful) language, and the proc macros are another thing again.

        Thankfully I find I very very rarely need to actually write macros, and you can avoid async most of the time unless you're doing web dev.

        Still a fantastic language - easily the best at the moment IMO, but I see his point.

    • m11a 3 days ago |
      But Rust is a systems language, for which Rust is excellent. Among its peers, I find C++ blog posts even less coherent.

      Despite recent trends to use Rust for everything, it’s not supposed to be used for CRUD apps. I think this blog post is really just a case study in “use the right tool for the job, not necessarily the language you enjoy in your spare time or the latest trend in programming”

      • nbittich 3 days ago |
        Lol it's funny how often I get "but rust is not for making crud", although I never said I was using it for that.
      • nbittich 2 days ago |
        It's funny also because this is basically what you read when you arrive on the landing page of rust: A language empowering everyone to build reliable and efficient software.

        Crud are still software I think

    • spacechild1 3 days ago |
      Rust is essentially a C++ replacement. If you can afford a garbage collector, there's no need to use Rust or C++ and worry about memory management. Some people are promoting Rust as a general purpose programming language - which it is in theory - but so did people with C++ in the 90s.

      > sparing few allocations

      Minimizing memory allocations is typically what you want when you reach for Rust or C++.

      • nbittich 3 days ago |
        Sparing few allocations at the risk of making the language inconsistent is an extremely bad way of building a programming language. If you write async code, rules are not the same than non async code. I am using rust for 4 years, I think I have a good enough level with it and thank God I kept my objectivity. Btw this is at the first page of the rust website, not "c++ replacement" : A language empowering everyone to build reliable and efficient software.
        • spacechild1 2 days ago |
          > Btw this is at the first page of the rust website, not "c++ replacement"

          They wish :) Why should anyone - apart from aesthetic preferences - fight the borrow checker and deal with long compile times when they can just use a language with GC? It just doesn't make sense to me from a technical standpoint. You reach for Rust or C++ when you can't use C#, Go or Java.

          > If you write async code, rules are not the same than non async code.

          The thing is: Rust is (also) catering to people who want to write async code on embedded devices.

  • smrtinsert 5 days ago |
    Not getting this one. Programmer writes app in framework he knows experiences productivity?
  • ilrwbwrkhv 5 days ago |
    Rust is fine.

    The worst is TypeScript and Node.js.

    A lot of startups are making their code bases in TypeScript. And it is an unbearable mess.

    I recently consulted with a company where I rewrote their app in Rails. And now it's much simpler, much better, much more extensible, and far more enjoyable for the developers to work on it.

    • duggan 5 days ago |
      Are there persistent ways in which you think Typescript codebases end up a mess?

      Developers have to invent too much themselves vs Rails? Something deeper?

      • ilrwbwrkhv 4 days ago |
        There are many different ways how they make the code bases a mess but one very common way that I can pick out is a lot of indirection that is a lot of functions wrapping other functions which wrap other functions and so on where to change even one thing you need to visit and touch 40 different files.
    • alpaca128 5 days ago |
      As a Rust dev it feels like I can't rely on the Typescript compiler at all. If you don't spell everything out for it, it might silently fail to infer the type of a variable and suddenly the function returns a number array instead of a string and the compiler will be just fine with it. Not to mention runtime still has all the problems of JS.
      • kristiandupont 5 days ago |
        >[...] suddenly the function returns a number array instead of a string and the compiler will be just fine with it.

        The type checker is quite forgiving, but that does not sound like something it would just be fine with?

        The TS type system is not sound which has obvious tradeoffs. I prefer it over Rust for most things because Rust feels like a Comic-book-guy type person looking over my shoulder going "Akshually, you didn't tell me what the lifetime of this string is", even if it is trivially obvious. I acknowledge that there are situations where that is very valuable but in my opinion it's not generally superior.

  • pech0rin 5 days ago |
    Rails (and possibly Django and Laravel) are just light-years ahead of any other stack for building web apps. They have dealt with all the tedium, know all the requirements, and actually get out of your face when building an application. I have been developing web apps for 15 years now.

    I have tried Meteor (back in the day), Remix, Nextjs, Node w/ Express, etc. Always talking about how much better they are. But in my mind web dev is a solved problem. The js stuff is mainly just developers wanking off, driven by a bunch of dollars from big companies.

    Systems stuff, deployment infra, etc. is great for stuff like Rust & Go, but shoehorning into web dev makes no sense. I would love to just move on from this debate but it seems thats going to never be possible.

    • alanfranz 5 days ago |
      I must say that even if it’s not a trendy stack, I find Spring Framework/Spring Boot to be the best all-around web application stack. Very easy integration with the tons of java libs you have around that can do virtually anything, a statically typed language which can help in a lot of situations (just data binding by convention via Jackson is great since forever, while it’s an afterthought in dynamically typed languages).
      • t-writescode 5 days ago |
        I've been incredibly pleased with Ktor and Kotlin, as well. JVM underneath, robust libraries, easy to use infra, using Exposed for the ORM which is mostly (genuinely) a joy.

        The best thing I think Rails still has is ActiveAdmin. Everything else, I really can take or leave.

        • Tainnor 5 days ago |
          > The best thing I think Rails still has is ActiveAdmin. Everything else, I really can take or leave.

          ActiveAdmin gets you off the ground very quickly, but is also extremely inflexible (and, IIRC, poorly maintained). The last time I worked on an ActiveAdmin backend we had to use all sorts of weird hacks to build the interface the way our backoffice team needed it to be.

          • RangerScience 3 days ago |
            AA is really just some wrapper and glue around some other tools… which aren’t super well documented either, but it definitely does mean that a) you can do weird/custom stuff, and that it’s a PITA to figure out how.
        • dajonker 5 days ago |
          In another company I had to completely replace ActiveAdmin with "vanilla" Rails abstractions as it was quite buggy and caused Rails to hang indefinitely as soon as you edited any ruby file. The admin part also turned out to be the most used part of the app, so it probably made sense to replace it in any case, but the bugginess at the time was more than I could handle.
        • regularfry 3 days ago |
          Admin is the one area where Django has the edge, but it's enough on its own for me to push Django over Rails for a lot of "just put a UI around some data, please" use cases.
        • taikon 2 days ago |
          I recall Active admin having really clunky UI a couple years ago. I just checked it again and it looks really sleek!
      • egeozcan 5 days ago |
        I did write a lot of Java but never called myself a Java developer, and in my current company there are a lot of hardcore Java devs who used to swear by the Spring stack (some even liked JSF!), and a lot of them are moving things to Quarkus (https://quarkus.io/). No idea why, just an observation.
        • royjacobs 5 days ago |
          They are moving there because it's new and shiny, not because it's better.

          Spring and Spring Boot are incredibly productive and give you a ton of stuff out of the box, whereas some people actually enjoy writing a lot of plumbing code as a distraction/challenge from boring business code. Those people will migrate to "lean" frameworks because it will give them the opportunity to write more low-level plumbing code.

          • ffsm8 5 days ago |
            > They are moving there because it's new and shiny, not because it's better.

            I highly doubt that.

            The real reason is likely more about the GraalVM, which spring hasn't supported until very recently. (And still only with caveats)

            • royjacobs 5 days ago |
              That sort of proves my point, though. Spring support for GraalVM is ongoing and will likely be quite useable and mature out of the box.

              The people jumping to Quarkus or Micronaut are more eager to chase the new shiny and are willing to spend the time debugging not-yet-mature stacks.

              Edit: To be clear, the reply mentions fanboyism but we are talking about the maturity of a stack. Spring has been around for 20 years and is not going anywhere. Quarkus just reached 5.

              • ffsm8 5 days ago |
                The GraalVM is significantly more performant. Calling that "chasing the new shiny" redefines the meaning of the expression, which has historically been about side-grades for unclear advantages.

                Especially considering that Springs support isn't full yet, and quarkus has been around for 5yrs now.

                They're both production ready stacks though, really strange to have spring fanboyism in 2024

                • alanfranz 5 days ago |
                  If Rails is fast enough, I doubt plain old Java on a standard JVM is slower. We’re talking comprehensive and productive web stack, not raw speed, otherwise we go back to the Go and Rust case.
        • pjmlp 5 days ago |
          JSF can be a great experience when coupled with the right framework like PrimeFaces.
          • egeozcan 5 days ago |
            My impression after many years of working with JSF: PrimeFaces or not, it's a lot of server-side state making it hard to work on the front-end and an unnecessary burden on the server.

            I have also some nice things to say, and I'm not going to make a detailed analysis here but IMHO, it's really not worth the tradeoff.

            • pjmlp 5 days ago |
              Agreed, and yet the celebration of stuff like Blazor Server, Phoenix, among others show that some folks really like this approach.

              Personally the experience with JSF and Web Forms, is what makes me appreciate any framework that exposes the underlying browser stack, instead of pretending it is something it is not.

          • alanfranz 5 days ago |
            I need to disagree, as I think JSF to be a rather clunky approach, but I admit I never used PrimeFaces.
      • michaelmior 5 days ago |
        I think part of the problem may be that a lot of people are familiar with old versions of Java before things like lambdas and anonymous interface implementations were possible. Writing Java without some of those things can be pretty painful.
      • camdenreslink 3 days ago |
        ASP.NET Core is similar. Not necessarily trendy, but very efficient to work in.
    • egeozcan 5 days ago |
      From my experience, these frameworks are like the express lane for kicking off a project because there are no big decisions to make. But once you’re knee-deep in Rails, Django, or Laravel and need to do something off the beaten path, things can get dicey. Why? Because you didn’t write the glue code yourself, so there's a gap in understanding, not really a technical roadblock (most of the time!). My point is, if you dive into these frameworks and actually learn the guts, you'll save yourself tons of time coding by, well, reading code.

      Now, do I actually do this? Absolutely not. Rewriting everything is way too much fun, and I live for the thrill of trying new things, even if it makes zero business sense.

      • whamlastxmas 5 days ago |
        What’s an example of a feature for a Laravel site where not fully understanding the mechanisms of Laravel under the hood would make that existing code get in the way of building the new feature? Genuine question.
        • egeozcan 5 days ago |
          Luckily I have a real life example from a customer project I was involved as a consultant: Integrating a custom identity provider with multi-factor authentication. This was from many years ago though. They also used to have some performance problems in some naively implemented middleware and needed to deep-dive into how things actually work before being able to optimize. And commands - I was doing the integration with our software and their command queue was always causing problems with stuck jobs until they read the implementation. The specific problem with Laravel as a product is (was?) that the docs are too beginner oriented and perhaps "you don't need to know what's under the hood" mindset is exactly what's causing this. I got to know many experienced PHP developers who got really frustrated because of the ELI5 style docs.

          You can't always rely on the docs too, however excellent they may be - some game developers read code from game engines to optimize, some web developers read code from their web frameworks. But, some change their whole stack when they get frustrated, and I argue that it makes little to no business sense to do so. Just understand what you are working with and deeply.

          • Chiron1991 5 days ago |
            I can't speak for the other frameworks, but with Django this would have not been a problem at all. In Django, most "batteries included" features really just are 1st party plugins, i.e. you can choose to not use the builtin authentication stack and bring your own. All of this is officially supported and well documented, e.g. https://docs.djangoproject.com/en/5.1/topics/auth/customizin...
      • physicsguy 3 days ago |
        When I first learnt Django I sometimes felt like that, but I actually found the source code for it and DRF to be very readable, to the point that it's very obvious where they expect you to step outside the guardrails.
        • marky1991 3 days ago |
          As a personal anecdote,I have not at all found this for drf. I personally dread every time something goes wrong in our api code, it's a sea of overcomplicated inheritance trees (some of this is our fault, but it's at drfs direction imo) and factors that eventually just end up with me never being able to find where anything actually happens, other than via a mountain of print statements.

          Django by contrast, I agree, it's perfectly clear. (Though some of the meta magic does get spooky, but that's the nature of meta magic, and I generally find the tradeoffs are worth it)

          • camdenreslink 3 days ago |
            I find DRF has a lot of places where someone can alter the behavior of handling the request, which can make it really hard to track down where some field or behavior is coming from. You can define methods on the view, serializer, model, or filter (or some superclass of these) to totally change how some response is formed. It is very flexible, and can save a lot of typing if you have all the conventions in your head (and everybody working on a project strictly follows the same conventions). But I find plain Django or something like Flask much easier to grok.
          • physicsguy 3 days ago |
            I liked https://www.cdrf.co/ for exploring DRF.

            You basically have either a property or a function with the name get_property for a certain number of things (queryset, serialiser, pagination class, etc.) in any case. I tend to recommend in our projects style guides that once you want to override the behaviour of a mixin, you don’t inherit from the mixin anymore.

            The two biggest issues I came across with teams in DRF were people coupling the serialised directly to a single database model (i.e. using ModelSerializer everywhere, even when that didn’t make sense), and trying to put too much stuff into a single class based view or viewset.

    • ethagnawl 5 days ago |
      I came through to note that most of this applies to Django, too.

      I've historically preferred RoR but with the tremendous growth of Python in the last 10+ years, Django has become a more practical choice. ML and data science devs are already familiar with Python and, with the Django docs being as excellent as they are, these folks can be productive in a very short amount of time -- should they need to be. I've seen this firsthand on multiple projects.

      Also, along with the author's case for the path of least resistance, the Django framework results in fewer "decisions" (arguments) about application structure than using a less opinionated library or micro-framework.

      The Django/FLOSS community is also much more active than I was expecting it to be (Rails bias, probably) and has been very pleasant to interact with.

      I only wish Django had Rails-like generators and in-built data seeding (e.g. rake db:seed).

      • appplication 5 days ago |
        Django has been an absolute pleasure to work with. Contrast it to flask, which is a complete footgun factory. I agree 100% on there being (honestly, massive) value in reducing decision points in the project. Very few devs truly have the experience needed to see around the corners in their designs and architecture, and Django represents the culmination of decades of learnings on what works, and works well.

        Overall, I’ve been very impressed with the product and maintainers. There are so few OSS projects that rise or the level of quality that Django has managed to achieve. Now if only they could sort out type hints ;).

      • physicsguy 3 days ago |
        You can seed with JSON files as "fixtures" and run `python manage.py loaddata fixturename`.

        The thing I wish Django had better OOTB support for is background tasks, I've not used it but I understand this is very well done in Rails and Laravel.

        • ethagnawl 20 hours ago |
          Interesting! I will give fixtures a look. I've shied away because -- unless you introduce a manual step to generate them, my understanding is that they're static.

          You're spot on about background jobs. Rails added support 2-3 major versions ago and there's no shortage of back-ends. With Django, it seems to be Celery-or-bust and there's no Django API that I'm aware of. I actually recently rolled my own solution using SQS and a dedicated compose service which runs a management script (in the Django context). It works but ... it's klunky, the API is ad hoc and there's no monitoring/retries/etc.

      • pooingcode 2 days ago |
        I picked up Django as my web server of choice this year and found the same delightful to work with. Given I generate content outside of the django app I had to roll my own data seeder.

        It’s actually quite straightforward using CSVs and models to load each row in.

        Can see it getting complex once I need to seed a large dataset or with loads of relationships. Look forward to seeing an official 3rd party app that takes away the complexity from my code base for seeding.

        • ethagnawl 20 hours ago |
          I've been using django-seed and it's fine. The API is a little confusing, it hasn't been updated in years and there are some sharp edges (e.g. auto-M2M2M).

          Yes, to your point, it would be great to see the jazzband project adopt/anoint it or another solution.

    • rockyj 5 days ago |
      I do not agree. Rails is absolutely great in terms of features and productivity, but will fail you elsewhere i.e. it is not the silver bullet for webdev. Do not take my opinion, look at data - https://www.youtube.com/watch?v=Qp9SOOtgmS4

      If you are using Rails for anything where you are not absolutely sure of how many users or RPS you will have, you are just saving money in launch time but spending more on servers.

      • BoumTAC 5 days ago |
        Shopify is built using Ruby on Rails, they successfully handle enormous traffic spikes during Black Friday sales without issues.

        So I think we're good with performance.

        • rockyj 5 days ago |
          Everything can scale if you throw enough servers at it. Of-course Shopify scales, they even spent time and money to build a JIT on top of Ruby. As a smaller company, does everyone have the time and money to spend on servers or optimising the language to this extent?
          • lentil 5 days ago |
            Smaller companies have less traffic, need less expensive servers, and have no need to spend money optimising the language. They can focus on that when they make billions of dollars, like Shopify does.
            • axelthegerman 5 days ago |
              And in the meantime just passively benefit from the OSS improvements along the way
          • chucke 5 days ago |
            No, they only have time for features and productivity, which is, as you pointed out earlier, what rails is good at.
          • bnferguson 5 days ago |
            That's the nice thing! You don't need to optimise the language and build a JIT as a smaller company, Shopify already did that for you. Just like Google did for Javascript, which lead to Javascript having any performance at all (which lead to node being a thing).

            Also remember that Shopify didn't start out making billions. They started as a small side project on a far, far slower version of Ruby and Rails.

            Same with GitHub, same with many others that are either still on Rails or started there.

            You can optimise things later once you actually have customers, know the shape of your problem and where the actual pain points are/what needs to be scaled.

            To me, I care a ton about performance (it's an area I work in), but there's not a lot of sense in sacrificing development agility for request speed on things that may not matter or be things people will pay for. Especially when you're small.

        • ksec 5 days ago |
          >So I think we're good with performance.

          >On Rails, the most heavy page has a P95 duration of 338 ms. There is of course room for improvement but it's plenty snappy.

          I guess everyone will have different opinion on P95 at 338ms. The great thing is that we are getting cheaper CPU Core price and YJIT. As long as this trend continues, the definition of Fast Enough will cover more grounds for more people.

          • dajonker 5 days ago |
            There's lots of tricks you can do, such as preloading pages when the users hovers over the link. This makes even a "slow" page load of 400ms feel pretty much instant to a human.
      • CPLX 5 days ago |
        > just saving money in launch time but spending more on servers

        That seems like an amazingly good trade off, even if it were true which I am not sure about.

        • timeon 5 days ago |
          It is. On the other hand this kind of mindset is the reason why there is climate change.
          • CPLX 5 days ago |
            I’m pretty sure the decision to use Ruby On Rails instead of another platform for building my web applications is not in fact the reason why there is climate change.
        • graypegg 3 days ago |
          I'd go as far as saying it's a selling point, not just a compromise. Flexibility now can come at the cost of vertical scaling when it's EASIER to get funding and when you will probably have cash flow? Hell yeah. Compared to preemptively hyperscaling at an initial high cost, or using a possibly non-existent mythical framework that is somehow hyper performant, low cost, and as flexible as Rails etc... I know what I'd go with.
      • hit8run 5 days ago |
        If RPS become a problem you can probably switch to JRuby. I did exactly this 15 years ago for EUs biggest software company and it worked out quite well.
        • rockyj 5 days ago |
          Have you seen the latest state of JRuby development or seen the posts of its development team. If you are comfortable with the idea of your main runtime being dependent on the time / finances / availability of around 5 (or less) core developers I would say you are ok with JRuby.
      • biorach 5 days ago |
        > you are just saving money in launch time but spending more on servers.

        But... That's kind of the whole point

      • wutwutwat 5 days ago |
        the "rails doesn't scale" myth has been debunked for a decade now and anyone with the slightest clue about performance can scale a rails app using the same techniques that you'd use to scale any other language and framework

        yjit and fibers have made things even better, and plenty more is coming I'm sure

      • dajonker 5 days ago |
        These kinds of tests are useless (to me at least) for three reasons.

        First, these kinds of tests don't do anything useful and just show that some frameworks have more overhead than others. Once you have an app that was developed over years rather than hours and actually does a lot of stuff on every request, it's a whole different game.

        Second, the kinds of applications I write rarely get more than 10-20 requests per second. If Rails would peak at 2500 rps as that YouTube video tests it at, that would be plenty. If I were writing some kind of IoT platform rather than a business app, I'd probably not start with Rails for that reason.

        Third, for an actual web application, you want to consider what the user experiences, not just how fast the server responds. You can make an application feel much faster than the server response times by preloading on hover, (http) caching, async loading of things that are not visible yet, etc.

    • awongh 5 days ago |
      I like the rails dev experience, but it feels like they haven’t come up with nice new front end solutions that an integrated framework like nextjs has done.

      One specific example is images and srcset. If you are doing a react front end anywhere in your app (not even an SPA) interfacing with the asset pipeline doesn’t have a canonical solution.

      This just makes it feel behind the times, since what I always liked about rails was the “one right way” that was always reasonably sane.

      So it feels like nowadays you need to trade user functional front end app things, like load time and LCP for dev experience in rails. Sad.

      • theappsecguy 3 days ago |
        I mean the Rails way would be Hotwire. It’s dead simple and a joy to program.
    • pjmlp 5 days ago |
      As someone that used AOLServer, was in a startup doing something like Rails but in 1999 with Tcl, I don't really agree.

      The Rails demo wasn't that appealing to me, other than showing the difference on how lucky one might get regarding adoption and spotlight being in the right place.

      Nowadays I still don't see a value, and rather go for Spring or ASP.NET.

      By the way, the founders of that Tcl based startup, went on to create OutSystems, which is one of the few successful RAD tools for Web development at enterprise scale, and Portuguese success stories in IT world.

      • ridruejo 5 days ago |
        Tcl for web development was great and AOLServer ahead of its time
    • gardenhedge 5 days ago |
      I disagree. Rails is fine but just a differential approach. I prefer a standalone fronted that talks to an api layer. Web Frontend for me is remix. Mobile is react native and api layer could be any language you're productive in, eg. Java,.net or javascript.
    • tomwphillips 5 days ago |
      I agree.

      Unfortunately every team I’ve worked in hasn’t seen the light and prefers FastAPI/SQLAlchemy/Pydantic (before FastAPI it was Flask).

      My theory is that the initial learning curves are different: with FastAPI it’s quick and easy. You barely have to read anything. Django has a steeper learning curve. There’s a lot of reading involved. Type hints aren’t a big thing in Django, but they are in FastAPI, and the average full stack dev seems to like them.

      Later on it’s totally different of course. With FastAPI you’re building it all from scratch, and it’ll be much worse than the Django solution.

      • allendoerfer 5 days ago |
        Type hints are were the whole Python ecosystem is going, so using them is more integration at a deeper level than using an integrated framework, which is not relying on them.

        SQLAlchemy was historically a much better ORM than Django's. It's layered architecture combined with Alembic does make a difference.

        I still agree that using the integrated thing anyway is probably the right way to do it if you are working in a team. I also think Django should just adopt these components and we would not have the discussion in the first place.

        • jonatron 5 days ago |
          I think SQLAlchemy vs Django ORM was a 2007 blogging topic: https://www.b-list.org/weblog/2007/sep/04/orm-wars/
          • allendoerfer 5 days ago |
            While it is not Django's responsibility to unite the Python ecosystem, continuing to rely on a tool a sizeable share of the community deems inferior to a popular alternative will keep these discussions open and results in the fragmentation OP is talking about.

            Now of course it is not Django's responsibility to unite the Python ecosystem in the first place and they can value other factors and arguments as they see fit.

            Although this very thread shows that there might have been something to it.

            • cloverich 5 days ago |
              A corollary is the debate itself leads to a waste of effort that multiplies across all users. I use Rails only in anger, but to see literally nobody bike shed on the ORM is pretty amazing. Seems like you use Active Record or you write SQL and either way move on with life.
              • chucke 4 days ago |
                In ruby, the sequel database toolkit is vastly superior to activerecord, and that is a subject of discussion here and there. The difference is that rails is what most rubyists use at work, unlike in python, where choices are more diverse.
            • physicsguy 3 days ago |
              Why would Django move away from an ORM that works, at scale, in millions of deployed websites? They'd have to support both for many years in any case.

              > a sizeable share of the community deems inferior

              Well, yeah, SQLAlchemy is standalone, you can use it in a lot more situations than Django's ORM in practice, because you're not tied to using it in a Django site. But that doesn't mean it's "better"

        • tomwphillips 5 days ago |
          > Type hints are were the whole Python ecosystem is going

          I see what you’re saying, but a lot of Python users, especially those who have been using it pre-3, would say that this is unfortunate.

          > I also think Django should just adopt these components and we would not have the discussion in the first place.

          Oof, such a monoculture sounds terrible to me!

      • physicsguy 3 days ago |
        I've had this debate with someone recently, as soon as you actually want to use FastAPI/Flask in something that's not an internal only microservice, you end up building Django on top of it anyway ad-hoc way. It also ends up in more of a mess, because while Django doesn't enforce a code structure as such, the default way of doing things is fairly good.

        The main thing I miss about Django is always the DB migrations in any case. I found that pattern to be very flexible and very powerful.

    • Volrath89 5 days ago |
      Dotnet is also very good for building web apps, it also includes static typing and a huge ecosystem.

      I agree that web dev is basically a solved problem, I don’t know why stuff like next.js exists

      • phist_mcgee 3 days ago |
        Some people like writing typescript.

        This forum leans backend heavy and there's definitely a bias against using javascript on the backend. But many top websites use it for their infrastructure. It's not all hype driven development.

    • keb_ 5 days ago |
      I've been working on a Rails codebase for a few years now. The biggest downside coming from TypeScript codebases is that lack of static typing and the immature static typing ecosystem in Ruby. I know DHH publicly denounced strong typing, but if you're coming from a language with it, Ruby & Rails is a hard sell.
    • timkofu 5 days ago |
      Django.

      Plus with Django and Py03, one can write the service layer in Rust(if you’re into that).

      It also enables building an interface to Python’s data tools.

      • pooingcode 2 days ago |
        I use Django and did a deep dive into py03 the other month seems straightforward to use.

        What use cases with Django would you say it makes sense to reach for?

    • gepardi 5 days ago |
      “… the rest is developers wanking off …”

      Hahaha this made me chuckle out loud.

    • shtopointo 3 days ago |
      Why bunch Node w/ Express together with the others and dismiss it? (genuinely curious).

      Rails has a high learning curve. Perhaps people working with it for years don't notice it. Node + Express seems faster to learn and ship, but my experience with Rails is limited.

    • vr46 a day ago |
      I just spent two weeks wasting my time trying to code my pet project in various flavours of Next.js plus Prisma/Drizzle etc and gave up at having to constantly reinvent the wheel or work around some incomplete/naive implementation. And then went back to Rails where everything just works. Etc etc etc
      • mattgreenrocks 19 hours ago |
        It always sounds mean to say it, but there are definitely some things in JS land that feel way more amateur hour by comparison to more established ecosystems.

        Somewhat unfair comparison but I expect authors to at least learn from the mistakes of the past.

  • ridruejo 5 days ago |
    Somewhere, DHH is reading this and smiling…
  • steve_gh 5 days ago |
    This:

    "Have many issues at runtime? Test more. Does it turn into unmaintainable spaghetti code after a while? Only if you let it. It's typically caused by developers, not programming languages or frameworks."

    • t-writescode 5 days ago |
      And when the code becomes spaghetti, types will make it far easier to trust that the de-spaghettiing of it is safe.
    • yxhuvud 5 days ago |
      Yes. I'd much rather work with developers that know how to untangle and fix spaghetti, than those that have their hands held so steady by the environment that when the spaghetti does show up they don't know how to get out of it.
      • sealeck 5 days ago |
        I'd rather use a tool that has footguns X,Y as opposed to one without them so that when (separate) footgun Z arises in both languages the developers are more used to handling lots and lots of bugs?
  • simonpantzare 5 days ago |
    Laravel with Filament is super productive also. Django used to be my goto for 15 years but the frontend infra, Livewire, and flexibility of Filament compared to django-admin are hard to beat.
  • block_dagger 5 days ago |
    React plus Rails is my favorite modern combo. Development bliss.

    https://github.com/shakacode/react_on_rails

  • jb1991 5 days ago |
    It’s fascinating to me to see that nowhere in this thread, at the time of writing, is mentioned what used to be the darling of web development, a language that seduced many ruby developers to crossover: Clojure. The times have changed.
    • duggan 5 days ago |
      I think Elixir/Phoenix may be seducing more of them these days.
    • frou_dh 5 days ago |
      To do Clojure web development was to noodle around stitching together various libraries piecemeal, i.e. the same thing that everyone who resists proper batteries-included web frameworks does.
    • pjmlp 5 days ago |
      Those folks are now bragging about Elixir, or maybe they jumped again into Gleam now.
  • crabsand 5 days ago |
    "I couldn't horseshoe a hard systems language to replace a web framework for a CRUD app written with soft language, so I had to go back"

    Rails is very good until you need to go off rails. Even in that case rewrites must be partial and not to aim to fully replace the original. Most of the time rewrites are a waste of time. This article could be true if you s/Rust/Ruby and tell the story in the opposite direction.

  • chikere232 5 days ago |
    Didn't we make this mistake and learn from it in 2005? I guess not.

    Ruby, and Rails, was an awful idea then and it's an awful idea now. Even in-browser stuff is moving to typescript to get away from having to write unit tests for basic type errors.

    But sure, let's dig up this failure and try it again

  • andrewstuart 5 days ago |
    There's this weird conceit that Ruby On Rails somehow has a monopoly on developer experience, that Ruby On Rails gives developers pleasure that is unique and uncopyable - a unique and utterly amazing and incomprehensibly awesome developer experience that no other language or framework can replicate.

    Rails developers smugly assert that Ruby on Rails is more productive than anything else out there.

    I call BS on the "Ruby On Rails is the very best by far" conceit.

    Ruby On Rails has a monopoly only on the perception that its developer experience and productivity is off the charts.

    Ruby On Rails is just another language and framework. There's literally nothing that makes it different or particularly special compared to anything else.

    Developers everywhere with Python or nodejs or TypeScript or C# or Golang have a developer experience that is just as great, without the high handed conceit that what they are doing is amazingly better than anything else.

    • frou_dh 5 days ago |
      SEGA used to have an advert, "To be this good takes AGES". Maybe Rails doesn't have a monopoly on having 20 years of continuous development refining it, but that's certainly not the norm.
  • lionkor 5 days ago |
    I'm a little confused about the comments here saying Rust is not great for web backends. I've had the opposite experience, building mostly small services like beampaint.com and probablyup.net. Maybe the complexity goes way up once you try to build a bigger app? I mean surely it does,but Rust is great at giving you confidence where you need it when you have large code bases
    • keybored 5 days ago |
      Right, wouldn’t the difficulty go up drastically as soon as you need more framework-territory things? Because the established frameworks have them out of the box but the Rust framework is unlikely to (due to age). Imagine going from just two of those missing things to six.
  • oftenwrong 5 days ago |
    I once worked for a startup that used Rails for building their web app. I would say around 50% of all development was in Rails. For things that demanded more performance or correctness on complex tasks, there were some Java services and some Postgres sprocs.

    Our user-friendly and featureful website was a big part of our appeal. A lot of the non-Rails functionality was the unseen "secret sauce".

    I think this approach worked well. Most of what you need for a web app is commodity functionality. Correctness is not even particularly important in many cases. The Rails ecosystem has a lot of useful tools that make it easy. For example, there are multiple options for automatically adding a comprehensive admin panel. This let our non-technical admins manually accomplish CRUD tasks in the web app's domain. This allowed us to avoid overengineering. We could implement something that covered 80% of cases, and manually handle any edge cases or things that happened infrequently. An example is locking user accounts when a person left a customer's company; they could just email us and an admin would manually go in and check the "locked" box for the user. This allowed us to move very fast on new web app features, and focus on other aspects of the system.

    There were downsides, of course. One of the big pain points was upgrading Rails itself, and dealing with dependency hell at times with various libraries. You also have to know many things about how Rails works, which involves a lot of quasi-mysterious and implicitly-performed things. For example, I recall frequently coming across function calls, and then I would look for the function definition, only to find that it was a function that doesn't exist in the code and was generated at runtime by Rails.

    • dajonker 5 days ago |
      The downside of using more than one programming language (not counting javascript) is that it makes everything more complex. Development, testing, deployment, issue tracking, etc. Plus it forces people to either specialize in one part of the application or learn two things in depth.
  • samjbobb 5 days ago |
    This was a great read. Thanks to the author for the vulnerability.

    In this thread and others, HN does a lot of talking about the fixed properties of these languages and frameworks.

    Something I don’t see much is: choose the tool that you and your team are most familiar with.

    It’s relatively easy to learn a new language, but it takes a long time to learn an ecosystem. Learning that ecosystem takes time away from focusing on your customer.

    I recently started a new web app and tried to use Django because of the batteries-included framework “should” have been the right tool for the job.

    But I haven’t used Django in 15 years and it was slow going. After a few weeks of slow going, I rewrote the whole thing in Typescript in a week. Not because of any general argument that TS is better, but because it’s the ecosystem I know well. Not by choice, but as a function of the jobs I’ve had.

    I’d like to suggest that it’s okay to choose the tool you’re most familiar with, because you’ll move faster, write better code, and frankly web apps can be written in any of these languages.

  • pmdr 5 days ago |
    Rewrite it in any framework that _doesn't_ make you dependent on platforms waiting to milk you dry when usage takes off.
  • yburkov 4 days ago |
    we are not in 2010, why use rail? There are a lot of alternatives - java (spring) - go - node. But using rust for it is not far from c++ by craziness. So you are jumping from one strange solution to another…
    • oliyoung 3 days ago |
      Because Rails solves problems the others don't.

      Also,

      1. Spring outdates Rails (2002 v 2007)

      2. Go is a language, Rails is a platform, Ruby is the language. Ruby and Go solve for different problems, Go doesn't have a singular web application framework to compare well to Rails

      3. Node is a runtime, not a language or a platform. There's no direct comparison there.

  • jairojair 3 days ago |
    Boring tech is great!
  • oliyoung 3 days ago |
    The keys here for me...

    > After probably a good year of writing Rust and Svelte, it dawned on me that our users didn't benefit from any of this.

    > With days and often weeks on end being spent on adding absolutely no direct value

    > these last weeks I've felt very productive again, building new features, improving existing ones, updating the UI, fixing stupid bugs. I also really enjoy working more closely with my colleagues who use the application all day, every day and figuring out how I can make the product better for them.

    Rails is GREAT at solving PRODUCT problems very quickly and very effectively. In the right place there is nothing better at building _products_ or making engineers incredibly productive.

    It's not the only tool in the toolbox, but it's always been one of the best to solve early applications and proofs of concept

  • m11a 3 days ago |
    I much prefer Rails to say Django, but I wish decent typechecking were possible in Ruby. All the options I’m aware of (Sorbet, header files, etc) are all so inferior to Python’s typing syntax that I feel like this alone makes me not want to use Ruby/Rails for web projects these days.

    I think decent type checking can fix many of the usual bugs people encounter, but the syntax for types at least needs to be decent.