News for hackers. Stuff that matters.
Re:What ORMs have taught me: just learn SQL (2014) by scarface74 on Friday September 20, 2019 @10:36PM (#21033143)
Eventually if you’re working with an object oriented language or if you have to convert the result to JSON, you’re going to have to convert one paradigm to another.

Unless you’re programming in assembly, everything you do is being converted into another paradigm that is what every compiler and interpreter does.

Re:What ORMs have taught me: just learn SQL (2014) by gernak on Saturday September 21, 2019 @12:06AM (#21033444)
You can only use a fraction of the features of a SQL database when you use an ORM because they don't translate to the new paradigm. When I am using a high level programming language, it is merely helping me do things like manage memory. I am not constantly wishing I could drop down and work with pointers and so on. It is a foundational paradigm that builds on the top of the one before it. ORMs just present a different, incompatible paradigm.
Re:What ORMs have taught me: just learn SQL (2014) by shkkmo on Saturday September 21, 2019 @12:34AM (#21033543)
> You can only use a fraction of the features of a SQL database when you use an ORM because they don't translate to the new paradigm

How does an ORM prevent you from using any SQL features?

When you do the sorts of complicated things that are out of scope for an ORM, you do them in SQL. I don't see any incompatibility.

Re:What ORMs have taught me: just learn SQL (2014) by scarface74 on Saturday September 21, 2019 @01:45AM (#21033723)
There are plenty of scenarios in certain verticals where you need to control memory management like games and others where you need to program in assembly. Garbage collection is an incompatible paradigm where you need to control when memory is allocated and freed.

Back in the day when I was doing C, there were times when we just couldn’t get the speed we needed from the compiler. I wrote inline assembly. Does that mean C was unsuitable because it was incompatible with our performance requirements?

Re:What ORMs have taught me: just learn SQL (2014) by gernak_ on Saturday September 21, 2019 @03:59AM (#21034079)
An ORM is not a high-level version of SQL though. A more accurate metaphor for an ORM would be like a converter from one high level programming language that is object oriented, to another high level programming language that is functional.
Re:What ORMs have taught me: just learn SQL (2014) by scarface74 on Sunday September 22, 2019 @07:39AM (#21040857)
In the case of C#, LINQ is a declarative built in part of the language. At runtime, it is converted into an AST and if you use Entity Framework, it is translated into SQL - another declarative language.

You can theoretically express any standard SQL query in LINQ even though outer joins can be obtuse at first. The translation may not be as optimal as hand written sql, but no compiler can translate code into assembly that would be as optimized as someone who could hand roll their own. We decided decades ago that high level languages were worth the trade off most of the time.