3 ms·
What advantages do you think SELECT a, b, c FROM d has over even a trivial modernisation like, say, table(d) |> select(a, b, c) ?
by roenxi 5y ago
What advantages do you think
SELECT a, b, c FROM d
has over even a trivial modernisation like, say,
table(d) |> select(a, b, c)
?
- mongol 5y agoShorter? No use of modifier keys? Just to name two. I think to do a meaningful comparison, more complex expressions should be used, that include joins, group by, order by etc...
- roenxi 5y agoThere is pretty overwhelming evidence that using modifier keys is an advantage in this sort of thing. Pretty much every other language - possibly all of them - in common use make heavy use of modifier keys in describing what a computer should be doing. SQL is pretty much the dying breath of the attempts to do without them because the syntax is so bad in practice. Even configuration files typically make use of modifier keys. Losing the explicit link between a function and its arguments is a big deal. Note that even the relational algebra model behind SQL doesn't try to make that sort of silly trade off.
- radiator 5y agoThe first example, you can read it and speak it in English.
- zozbot234 5y agoMost of the weirdness with SELECT could be fixed by switching the syntax to FROM ... WHERE ... [ GROUP BY ... HAVING ] ... SELECT ... ORDER BY.
- einpoklum 5y agoThe first statement is pretty close to a sentence in English. A non-programmer is somewhat likely to understand what the first statement means, but is not likely to understand the second without training.
- dbsmith83 5y agoreadability, typeability It makes formulating more complex queries easier when you can just say it out loud