I'm Switching from Laravel to Rails
old.reddit.com
old.reddit.com
- Lack of dependency injection/inversion of control. I find it interesting the author lists this as an advantage. With Rails, I was always a little anxious not knowing where things were defined or being implemented.
- Validation happens on models, not requests. With Laravel, I really appreciate being able to validate pretty much any data coming into the application regardless of whether or not it ends up in the database. With Rails, I tried to look for something similar to FormRequest and its validation rules, but I couldn't find many solutions. I think it might just be one of those things that's not the "Rails way".
- Perhaps more of a Ruby issue than a Rails issue, but the dynamism of the language - especially in its type system - was a bit of a drawback for me. I really appreciate PHP 8 and newer versions of Laravel for their support in type hinting and static analysis; being able to mouseover anything and know pretty confidently what I'm working with is a huge boon in my productivity.
I definitely agree with the author on a lot of the Laravel tooling stuff. I've learned to just kind of ignore most of the offerings outside of the core framework. I'm sure it's all great, but there's always a bit of churn in Laravel as the author mentioned so I'd rather save myself the future heartbreak.
This is why i switched from rails to symfony even though I hadn't had experience with those kinds of systems before. I took to it rather well
> - Lack of dependency injection/inversion of control. I find it interesting the author lists this as an advantage. With Rails, I was always a little anxious not knowing where things were defined or being implemented.
Rails itself doesn´t have framework/library for DI/IOC but you can use constructors, I understand that a lot of Rails devs won't and just use wtv they need.
I can look at the url of a new or old Rails app and predict consistently what routes, models, controllers and views exist within the app.
Convention over configuration keeps winning.
That is 100% true. Convention is an agreement we already had. It's much less effort, and more manageable to learn that, with the potential downsides as well, compared to figuring out the particulars of a custom configuration.
That's my experience with all of Rails.
Start with that pattern from the beginning.