35
Root
2y

STUPID RAILS!

WHY CAN'T YOU JUST BUILD THE BLOODY QUERY WITHOUT DOING FANCY UNNECESSARY SUBQUERY SHIT?!

OR PUT THE LIMIT WHERE IT MAKES SENSE AND DOESN'T CAUSE MYSQL TO TELL YOU TO FUCK OFF?

WHY WHY WHY WHY WHY

THIS ISN'T HARD

Comments
  • 6
    But but but....

    I'm an ORM beepity boppity boo, stuck in SQL standard foo.

    Subqueries are idiot - eh dev friendly, joins are bad, why u so sad?

    Some RDBMs have special stuff, I think I said enough...

    Queries as a string are too complicated, look at the fabulous text diarrhea I fabricated!
  • 1
    I feel like rails is no longer maintained, yes?
  • 2
    @johnmelodyme it's still maintained, but it's slowly losing community support.
  • 3
    @sariel that's bad.

    @root let me introduce you Phoenix elixir ... Jkjkjkjk
  • 1
    @johnmelodyme it's no worse than Java.

    I'm hopeful for a resurgence in a couple years TBF.

    If ruby wants to survive, it needs to replace rails and distance itself from the monolith.
  • 3
    @johnmelodyme At least, Elixir is based on the Erlang virtual machine and has built-in micro threads. Someone should add a proper type system to make it awesome - but it is a good language already (as is Erlang with its slightly more cryptic syntax).
  • 1
    @sariel Ruby's in a bit of a conceptual dead end from the way I see it, because they wanted to avoid making rules in favour of developer convenience and as a result created a system where even the most banal assertions - such as whether a field name can exist on a locally constructed instance of a statically created class - are uncomputable, and a lot of the actual ecosystem relies on this magic to monkey patch interfaces that are meant to be used very commonly by the client code.

    The result is that developer tooling is either manually extended for each and every library, or it makes correct assumptions less frequently than grossly incorrect ones.
  • 1
    They've added a good type system that preserves a lot of the language's dynamic nature, but it lacks support for many popular (anti)patterns because they're fundamentally antithetical to type checking, and the ecosystem is far too old and overgrown to remove these in favour of patterns that lend themselves to type checking, for debugger convenience.
  • 0
    @sariel java ... Who u#es java for backend?
  • 2
    @Oktokolo well elixir is fast and straightforward tho. Somehow I addicted using it.
  • 0
    I enjoyed reading your blog post on why rails are so complicated. I was like you and just wanted to query the database and that was it. I've been looking into learning rails recently and now I'm still struggling with the basics. I can't believe the amount of time it's taken me to get this far. I'm glad you wrote this post because it explains why all the unnecessary queries are being made.
  • 1
    @ericbeatrix But it doesn’t.

    My rant is complaining about unnecessary query complexity. The ActiveRecord query builder often makes complex queries instead of simple ones, and it doesn’t always place `limit` intelligently.

    Like any ORM, it takes quite a bit of practice/experience before you have a good idea what the SQL output is going to be — and even then sometimes it behaves unexpectedly, or is simply unable to produce the query you want. Both of these were my frustration today.
  • 1
    @ericbeatrix Also, blog post?
  • 1
    @Root mayyybe spam ;) not sure yet
  • 0
    Python Django provides a similar experience but quite supported

    Its ORM is flexible enough to fulfill all your desires, if u wish to have subqueries or lag function, or any other stuff.
    And if nothing fits (which is hardly ever to happen) u can always write and submit rawSQL request
  • 0
    @darkwind does Django has its own ORM? I thought they rely on SQLAlchemy
  • 1
    @bioDan yes, Django relies on its own ORM... Which is having a small drawback of it being still Sync only. They only try to catch up and introduce async into it. They planned to introduce it already at the end of previous year, hopefully during current year they will succeed to upgrade

    Tbh it is more popular / bleeding edge tech wise to use FASTAPI + SQLalchemy. FASTAPI is not forcing u to choose which ORM, and SQLalchemy already supports async operations
  • 0
    @darkwind i usually prefer Flask + SQLAlchemy,too much bloat in Django for my needs
Add Comment