Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The link that @Kyle Heironimus gave to Nick Kallen's thoughts on Arel had this line:</p> <blockquote> <p>You'll note the use of the derived table in the subselect. This is terrible, in my opinion. Only advanced SQL programmers know how to write this (I’ve often asked this question in job interviews I’ve never once seen anybody get it right). And it shouldn’t be hard!</p> </blockquote> <p>Well, Kallen puts this down to the lack of closure under composition in SQL. That may be true in some cases, but my experience is much more prosaic - that most devs are terrible at SQL. They only know the most basic things, these basic things are mis-used as they try to search for procedural solutions in a set based language. I had to argue the benefits of the database being in 3NF at one company I was at, with <em>all</em> the other devs, they just didn't get it. Talented guys (most of them:), but no clue about SQL or databases.</p> <p>Put it in C# or Ruby or Python &lt;insert language of choice> and the devs are happy again. They can stick with procedural/OO thinking and produce code that looks good to them.</p> <p>I know this won't earn me any votes, probably quite the opposite, but it's my view. Arel looks interesting BTW.</p> <hr> <p>As an addendum to the comments I've made above, over six months on and having used the Sequel library a lot during that time, I can say that it is indeed a beautiful thing, and now I feel that I would use it <em>ahead</em> of using straight SQL. Not only is it incredibly powerful and allow me to do simple and advanced things without too much head scratching (there'll always be some) it can output the SQL it has used, and it will also allow me to drop down into SQL if I feel I need to.</p> <p>This doesn't in any way nullify my comments about most dev's understanding of SQL, (I was recently told, by a dev that gives talks to others, that normalisation was a relic of a time when storage space was expensive... oh dear!) just that the development of the Sequel library has obviously been done by those who really understand databases. If you know SQL and db design etc then it gives you more power more quickly. I can't say the same of the other ORM's I've used, but perhaps others would think differently.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload