Hacker News new | ask | show | jobs
by quickthrower2 1064 days ago
That was a fun read. Not sure what to do with this information? When I write SQL I don't think of it as declarative - I think "what is the computer doing" roughly. Which is why I have found ORMs used in teams to be a bad idea because:

1. Step 1: use ORM - it's nicer and you can use C# or whatever.

2. Step 2: build an OO library of classes that call the ORM to do what ever.

3. Step 3: compose these, to build more complex operations. After all it is all free, you just compose the "InvoiceSubuery" and nest that inside the "UserSubquery" and so on

4. Step 4: production issue, database maxing out at 100%, sql query is 1000 lines long and about a million characters. It is joining 50 tables and aliasing them as EXTENT1, EXTENT2 and so on. Query plan is doing more scanning than the USS Enterprise in an unknown quadrant it got teleported to by the Q. You are having a bad week my friend.

5. Step 5: Step 4 happens every night, pager wears out.