Ruby, between versions, doesn't have many breaking changes, if any. They're more additive changes than they are subtractive. That obscure gem that has a last commit date of 2 years ago? Probably still works. Bundler complaining the Ruby version isn't supported in the gemspec? Fork, edit, push, bundle, success.
When you say basic stuff, I think of "busy work that's already solved by someone else, probably in a more complete than my half-assed attempt would be just so I can focus on more domain-specific problems and implement business logic." That's a fine tradeoff. My clients don't pay me to implement things like authentication or design an ORM: They pay me to do business logic. `bundle add devise; rails g devise:install; rails g devise User; rake db:migrate` gets me rock-solid authentication and I didn't have to think twice about it.
"Look at all the things I'm not doing" was something DHH said when he released Rails. A lot of Ruby is the same way. That's fine with me, and a lot of others.
There's a lot to love with Ruby in 2020. I still find it to be the most hyper-productive ecosystem and it doesn't change daily (see: Javascript's ecosystem). It's a language that's expressive, enjoyable, and plain fun. And for the very vast majority of web applications — which are CRUD-centric — Rails is still an extremely valuable means to get up and running. Scale? 99% of us won't need to worry about scale, and when we do, that's a great problem. Speed? For 99% of us, our database will be the slowest part of our application — even when indexed and tuned.
Sure, it may not be 2020 sexy. The socks you're wearing probably aren't either, but they still get the job done.
Personally I don't mind magic or hidden state that much but then again I came from perl.
- Rails is the monolith that gives you all of that auth/database/etc capability, and it's very non-trivial to upgrade
- Refactoring a large codebase with a dynamic, untyped language like Ruby is extremely difficult without 100% test coverage
- Unusual syntax conventions which can get you into trouble (y = x.blah vs x.blah!), strings vs symbols, magical naming conventions for Rails, etc etc
- Auto-loading is a mess
- ActiveRecord is great until you care about DB performance, and then you end up continually working around it's quirks (the N+1 problem, indexes failing due to int/string type conversion, etc)
- Everything in Rails is convention over configuration. File paths, names of classes, names of routes, mapping of AR to DB table, etc. Sure it "just works", but when it doesn't, it's not always easy to figure out why.
- Monkey-patching is cute, but, seriously? Hot-patching system library functions?
- What's a variable? What's an accessor? What's a function? Parentheses are optional, return is optional (yet @ is required for class/instance vars?)
Again, none of this prevents you from building a quick and easy CRUD app, but I've found the deeper I go, the less I like it.
And Rails itself is less monolithic than you think. You can swap out most of the components for other gems, like ActiveRecord vs. DataMapper (though I am not aware of anyone who does this anymore and the level of support for Rails gems generally outclasses everyone else) or remove those components entirely.
Much of the "Rails magic" is inside ActiveSupport, which you can import without bringing in all of Rails proper. Personally I think much of the stuff in ActiveSupport should go core.
It sounds like you had to dive head-first into a mess where it was hacked together by non-Rubyists who learned "just enough" to push to production, and were by no means diligent about following Rails conventions.
Obviously, this issue is agnostic of what language one chooses. But it certainly leaves a bad taste when there's all this "magic" happening (see: metaprogramming). That magic is what makes working with Rails so productive.
Rails makes it easy to do bad things because of how magical it is. `@post.comments.each { }` when you didn't preload `comments` is bad. This is fixed with `Post.includes(:comments)`.
Similarly, if you avoid its conventions — overriding `table_name` on your model, in your example — and try work against it, rather than with it — it becomes more of a chore than it does a treat.
Like all frameworks, they require a little bit of diligence and care and understanding to really get the full effect. Rails is great because it makes a lot of assumptions at the cost of brainpower, and for the vast majority of things this is good. It's not always the right tool, and it doesn't need to be. But when it is — again, a large majority of web apps are just CRUD — and when it's written with a little bit of care, it's great.
Also, type hinting is coming to ruby 3.
> magical naming conventions for Rails
That's rails' problem. I don't like it either but nothing to do with ruby.
Seems like half your problem comes from rails.
FYI see Zeitwerk gem for autoloading improvements.
Rails is neither the language nor the standard library, so the “unless” part seems superfluous.
> These then tend to go out of date. It's pretty common to find well-used gems that haven't been updated in 5, even 10 years. This puts the developer in a tough spot - reinvent the gem/wheel?
If it's open source, why would reinvention rather than forking and assuming maintenance (for one's own needs, not necessarily publicly) be an issue?
The community is us. Ruby is what we make it. So let's make it better.
I'm leaning towards a full TypeScript stack for my next project. The idea of sharing types & code between client & server is incredibly seductive. But there's no Rails for TS/Node, so I know it's going to be a shit show assembling all of my chosen libraries into a cohesive whole.
Although looking at your previous comment, perhaps I should give Kotlin / Ktor a try?
I'd love to think that Raku (formerly Perl 6) would be that language, but it doesn't seem like the trajectory is there.
Compared to which other language?
Java, for one, but obviously it's subjective
You can fork any gem in github, fix whatever issue it has, and point your Gemfile at your fork on github. Bundler treats it as the same package so it doesn't break your dependency tree either above or below it. I've used this to fix an incompatibility in the middle of my dep tree before. It's annoying, but it's not exactly a big deal.
Thus, there's always the desire to use third-party gems to achieve pretty basic stuff (localization, decent networking/REST, database drivers, etc). These then tend to go out of date. It's pretty common to find well-used gems that haven't been updated in 5, even 10 years. This puts the developer in a tough spot - reinvent the gem/wheel? Or be forced to stay on an EOL version of Ruby?