Hacker News new | ask | show | jobs
by vinceguidry 3679 days ago
That sounds like the pain I went through when I tried to write my own ORM. You want to go nuts with refactoring, chasing an ideal design that just doesn't exist.

> So these days I'm much more likely to write this in Scala:

I do this sort of thing a lot in ActiveRecord. I'll write a class method with ".where('price is null or price < ?', argument)". I use ActiveRecord a lot like I use Sequel, drilling into the underlying database layer. It occasionally bites me, but when it does, it's a good reminder to simplify my database architecture while nothing else is relying on it.

This way I can get the benefits of an object that behaves the way I want it to behave, but also respects the data layer. I don't want to give up either.

I do feel like Rails, in an effort to make things easy, encourages devs to overcomplicate their apps.