Rails isn't dead. In fact Hotwire and Stimulus have breathed some new life back into the community. With Rails 7 there's new and interesting changes happening like the normalize method for normalizing data before it's persisted to the database, the new testing coverage, and the new encrypted credentials, which can replace devise as it's easier to extend. STI is still awesome and concerns help DRY up the code. I know it's not the new kid on the block anymore, but if you code into a Rails way of doing things it's still crazy fast for rapid development.
Ruby is a very beautiful language both in logic and consistency. Rails is a mature framework. The ecosystem is very much alive albeit not “exciting” anymore and at the end of the day people use what they know. The 2010s have produced a large number of Rails developers. For the majority of CRUD apps Rails (or Laravel or Django) are just fine thus there’s no need to really make a switch. Finally, React can power a lot of things but in my experience it is far from offering the right integration and rapid development speed that something like Rails or Laravel come with.
> But in 2024 things like react and typescript exists.
Avoiding this stuff is one point on the list. I know I'm being a little snarky, but it's true. If you're building a fullstack app with fullstack devs you can avoid a lot of complexity that stuff brings.
These are nonstarters for me. It seems like vercel has corrupted react beyond recognition, and other full-stack frameworks like Remix just do a lot of `rigamarole` to mimic a fraction of what an older fullstack framework like rails/django/phoenix can do.
frontend is desperately trying to catch up to backend.
backend is trying to capture frontend to seduce people back, and they're getting there with freakishly good UX like phoenix liveview and rails 8's morph.
Rails is practically unusable for anything that requires concurrency inside of serving one request. If you have all your data in the database that your rails app connects to everything is great. If you need to call out over the network to 12 different services to serve your request or want to do computationally intensive things, etc, another language with support for concurrency is a better choice imho.
Yeah, right. Because all the interesting things nowadays happen on the same server that renders your html and nobody calls into other SaaS APIs or interacts with external systems much.
Rails is great for a world where an app was running on one server, but that world just isn't there anymore as much as it used to.
> Rails is great for a world where an app was running on one server, but that world just isn't there anymore as much as it used to.
No, that’s still a choice you can make. It’s still possible to make your app run on one server with Rails/Django/PHP and to scale it horizontally and vertically very easily. The requirements of a web app / web site barely changed in 10-15 years, the only things that changed is that new ways to do the same things appeared regularly : some were real improvements, most are just hype-driven.
If you need to call external APIs you can still do it on the client if that’s what you want or on the server with task queues / messages queues which are still a good practice anyway and which can be handled by how many servers you want.
2. the result of doing this is not the beautiful ruby code you are used to, compared to languages that have been designed for concurrency from the beginning.
The currently prevailing model in Rails is that a worker is a process that has an instance of your application running (ie the code loaded, global variables initialized etc). Let's say your service makes a request out to OpenAI and waits 5s for a model inference response. During that time, that particular worker that is servicing your request will sit around, needs to keep the 300MB or however big your heap is in memory and effectively does nothing while waiting for OpenAPI to respond. If you have 30GB of RAM to play this game, you'd be able to have 100 workers like this running and you'd be able to service a whooping 100/(5s per request) = 20 requests per second.
Contrast that to other architectures like NodeJS where there's an event loop driving execution that would suspend execution and work on the next request while waiting for OpenAPI to respond. This enables you to service thousands or tens or hundreds of thousands of the same kind of request with the same amount of RAM.
There are approaches to improve this in Ruby/Rails like Fibers, however lots of libraries in the ecosystem use global mutable state and assume it's request local. If you have multiple requests served concurrently by the same worker, they'll overwrite this state and bugs will happen. Also baking this onto the language is not very ergonomical (beautiful in Ruby speech) if you compare it to languages where concurrency has been a primary design concern in the beginning.
The global state trap ... I wonder why people still do these things, especially in web context. Basically whenever one uses mutable global state and actually mutates it, one puts off issues to the future, until one day some poor soul has to deal with this or rewrite.