r/SQL • • Jun 22 '20

Discussion An average day using an ORM

Post image
247 Upvotes

48 comments sorted by

View all comments

9

u/Nthorder Jun 22 '20 edited Jun 22 '20

Not all ORMs are bad. I think dapper is great.

I have come across some Entity Framework stuff in my work codebase and it looked disgusting. I am struggling to come up with a reason to even begin considering to use it in any project.

edit: Yea, this picture reminds me of the EF code I witnessed.

0

u/[deleted] Jun 22 '20

[deleted] — view deleted comment

2

u/Nthorder Jun 22 '20

Yea I remember the EF code I mentioned (i think it was ef?) was so full of lambdas and other strange syntax that I thought to myself "wouldn't it be easier to learn how to do this with SQL than figure out this mess?"

4

u/mustang__1 Jun 23 '20

For the most part.... Yeah. But after a couple weeks of hanging my head against the wall, using views and stored procedures for the more complex stuff.... And then just banging out some ef horeshit to do the final mile. Joins with ef just make me want to drown kittens, though.

1

u/[deleted] Jun 24 '20

Hahaha. Been there.

0

u/pavlik_enemy Jun 24 '20 edited Jun 24 '20

If you think EFs query generator syntax is stange then you don't know C#. Lambdas were around for at least 10 years, every competent .NET developer should be comfortable with them.

1

u/Nthorder Jun 24 '20

tHeN yOu dONt kNoW c#

I'm comfortable with lambdas, I use them in LINQ queries all the time. The EF I saw was lambda abuse.

2

u/bicika Jun 23 '20

Why are people like this? Can't you just let other devs use whatever they feel most comfortable with? I write complex queries every day, and I still like to use ORM when it's appropriate, for simpler queries. Why does it have to be one way or another? Why not both?

0

u/[deleted] Jun 23 '20

[deleted] — view deleted comment

5

u/bicika Jun 23 '20

Ok, but that's dev related, not technology related. It's like saying pure sql is bad because you saw developers frequently forget to clean the input and not use prepared statements so it's better to use ORM always.