Re:Is ORM still an anti-pattern?
by evrimoztamur on Tuesday June 27, 2023 @04:51PM
(#36498454)
I also can vouch for SQLAlchemy, in the in the sense that it allows me to write SQL with confidence, where the code matches the query.
I haven’t seen someone use the phrase begging the question properly in… forever.
What is the proper usage?
I don't think I can summarize it concisely, so I'll defer to the wiki: https://en.wikipedia.org/wiki/Begging_the_question
In this case, the phrasing of the question implies something not at all evident, that ORMs are an anti-pattern.
Including here, since 'it never was' is a statement, not a question. So no question has been begged.
Re:Is ORM still an anti-pattern?
by DangitBobby on Wednesday June 28, 2023 @02:31AM
(#36503077)
You've misunderstood the comment. The question posed in the title of TFA is being begged.
Oh I see, 2 statements:
That's begging the question. It never was.
My only real ORM experience is with SQLAlchemy (and a tiny bit of trying to learn ecto) and based on this thread I have to ask are all the other ORMs just terrible?
I've been learning some rust lately and writing out boilerplate code to handle simple CRUD is painstaking and it feels like a waste of my time.
SQLAlechemy's ORM can get in the way a bit for more complex queries (or ones you are trying to optimize) but you can always just drop down and write the SQL for those specifically.
>are all the other ORMs just terrible
From what I’ve seen yes. My first ORM was flask-sqlalchemy. Migrating a database was literally just updating an object and running a command. No other ORM has been this seamless.
Some ORMs are awful to work with, but that doesn't mean the genre is a bad idea. I've loved working with SQLAlchemy over the years because it doesn't try to re-invent the whole idea of SQL. Instead, it gives you a convenient layer for building queries, passing them around, etc., while it concentrates on getting the details right so you don't have to futz around with them.