Hacker News new | ask | show | jobs
by _peeley 723 days ago
Interesting post. I've used Laravel for a few years now for work and personal projects, and I've really enjoyed it. I tried to test out Rails to explore other MVC web frameworks, and I just couldn't vibe with it. I think the major areas in which I was incompatible with Rails were:

- 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.

3 comments

Pretty much my experience as a frontend guy that had to fill in for a team reduction and had to start working on the Rails side of things. I always felt like I was just having to "know" what was going to happen. Unit tests, mocks, etc. were all coming back "ok" but there was always something in production that would act up. I had never this happen with the Java and PHP backends that I always had to touch up when there wasn't much talent available. Before I was let go from the Rails client I suggested that they invest in property based testing for all code as it was quite clear there were cases that weren't being thought of that existed in the application somewhere (undocumented, manually added, etc.).
> 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.

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

can you explain a bit what you mean with

> - 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.