5 ms·
> SQL may be a language for all those things, but unfortunately it's horribly bad at it. Any piece of software used incorrectly will seem "horribly bad". > Wi
by alex_lav 3y ago
> SQL may be a language for all those things, but unfortunately it's horribly bad at it.
Any piece of software used incorrectly will seem "horribly bad".
> Wilfully obtuse syntax
This is an opinion.
> Incredibly poor compositionality.
Another opinion.
> No testability worth the name
I would argue that "try it, observe side effects and rollback" as a language feature is more testable than many/most programming languages.
> The deployment model is a half-baked pile of perl scripts, and that's if you're lucky.
>> Any piece of software used incorrectly will seem "horribly bad".
I appreciate that you hate it. I don't even think you should care or learn it if you don't want to. But I think positioning things you don't understand or _want to use_ as "horrible" or "bad" or whatever is acting in bad faith. You're allowed to say that you don't like something and don't want to learn how to use it, without suggesting it's the tool's fault.
> So yeah, I use SQL like https://xkcd.com/783/ https://xkcd.com/783/ . I'm sure you have a bunch of cool data analysis tools in there, but please just shut up, give me the contents of my table, and let me process it in a real programming language where I have map/reduce/filter as regular composable functions that I can test and reuse, with a syntax that doesn't make my eyes bleed.
This comment directly demonstrates "I don't understand, I don't want to, just let me do whatever I want however I want", which is fine, but again, not the tool's fault you don't want to use it.
Quoting again because it's also relevant to this last comment:
>> Any piece of software used incorrectly will seem "horribly bad".
- lmm 3y agoAt some point there is an objective underlying reality. I've worked at a lot of places and never seen SQL done well; even the people who were happy with SQL had no automated testing, no compositionality to speak of, and a crappy deployment model (and would usually acknowledge all this! They just somehow didn't mind). If one person uses a tool badly that's maybe a problem for that person, but if everyone uses the tool badly that's a problem with the tool.
- alex_lav 3y ago“Everyone” in this context means “the places one individual person is aware of”, and when compared to _actual_ “everyone”, is mostly irrelevant though. The things you’re complaining about are solved problems, you just don’t care/refuse to acknowledge those solutions, it seems. Which is fine! Like I said, you can just say you don’t like something without trying to smear it.
- lmm 3y agoI do care, but the "solutions" are always vaporware. It's like when I complain about C++ memory unsafety and someone says "it's fine, under the new standard you can just use a safe subset of C++" and I say "ok, where's the definition of this subset and how can I tell whether a library follows it or not?" and they say "uhhh....". At some point you stop asking.
- alex_lav 3y agoThis is the second time you’ve said “it’s bad!” And then used a strange hand wavy analogy (in the first post, an xkcd comic) as an out. Again, if you don’t understand something and don’t want to, just say it, don’t paint it as bad. Enjoy your vastly inefficient and expensive map/reduce configurations if that’s what you like.
- lmm 3y agoYou want to be concrete? OK, literally every real-world SQL setup I've seen, when not piggybacking off the application-level infrastructure: - Has no way to deploy a specific historical version of the SQL (e.g. deploy this git tag) - Has no automated checking that the SQL behaves as expected (e.g. this query with this test data should produce this output; if it doesn't, the git tag will not be created). Even checking that the SQL is syntactically valid is rare. - Has no reuse of expressions smaller than a view/table - Has not even basic type checking, e.g. something that alerts if you are combining an expression that might produce null with an expression that does not handle null well - Has not even basic library/dependency management - Has no practical structured values (since none of the infrastructure that would make using ad-hoc temporary tables safe exists). CTEs are an improvement but still thoroughly noncompositional since you can only put them in one place. Let me guess, "these are solved problems" but no details of what you do to solve them, because none of the solutions actually work.
- alex_lav 3y ago> - Has no way to deploy a specific historical version of the SQL (e.g. deploy this git tag) Can you clarify this? Do you mean the version of a specific schema/query? > - Has no automated checking that the SQL behaves as expected (e.g. this query with this test data should produce this output; if it doesn't, the git tag will not be created). Even checking that the SQL is syntactically valid is rare. This is part of the purpose of transactions [0] > - Has no reuse of expressions smaller than a view/table Incorrect [1][2][3] > - Has not even basic type checking, e.g. something that alerts if you are combining an expression that might produce null with an expression that does not handle null well Incorrect [4] [5] > - Has not even basic library/dependency management Incorrect [6] > - Has no practical structured values (since none of the infrastructure that would make using ad-hoc temporary tables safe exists). CTEs are an improvement but still thoroughly noncompositional since you can only put them in one place. Can you clarify? How is a transaction + CTE/subquery not sufficient? > Let me guess, "these are solved problems" but no details of what you do to solve them, because none of the solutions actually work. Replace "none of the solutions actually work" with "I don't know how to use them", and yes you're correct. I'm happy to answer more of your questions in good faith, but I'm not really interested in debating a person with their head in the sand. Please let me know if I can help you, if you're actually interested. But also, as I've said, it's also fine to not want/not like this type of stuff. Different strokes and all that. [0] https://www.tutorialspoint.com/sql/sql-transactions.htm https://www.tutorialspoint.com/sql/sql-transactions.htm [1] https://www.postgresql.org/docs/current/sql-createfunction.html https://www.postgresql.org/docs/current/sql-createfunction.h... [2] https://www.postgresql.org/docs/current/sql-createprocedure.html https://www.postgresql.org/docs/current/sql-createprocedure.... [3] https://www.postgresql.org/docs/current/datatype-enum.html https://www.postgresql.org/docs/current/datatype-enum.html [4] https://www.postgresql.org/docs/current/functions-conditional.html https://www.postgresql.org/docs/current/functions-conditiona... [5] https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-nullif/ https://www.postgresqltutorial.com/postgresql-tutorial/postg... [6] https://www.postgresql.org/download/products/6-postgresql-extensions/ https://www.postgresql.org/download/products/6-postgresql-ex...