Live data from Hacker News

We Can Do Better Than SQL

edgedb.com

461–466 of 466 posts

Re: We Can Do Better Than SQL

#461
post #336

Earlier quoted context omitted.

A very simple, basic SQL query would be something like "select * from users where foo=bar;" Already, we're introducing a weird inversion of syntax that, in my experience, trips up people learning it: data in SQL is stored as "rows" with "columns" inside "tables". More formally, we've got a hierarchical relationship where Tables > Rows > Columns, yet we write the query as Columns > Table > Rows. There are far more con…

> db.users.find({ foo: "bar" }) I don't know MongoDB query language, but gah! that looks horrible. It uses three different syntaxes; dot notation, curlies/brackets and colon key value. Full of punctuation and doesn't read like english. There is no distinction between noun "users" and verb "find". There's extraneous "db". does foo: "bar" mean equal or is it find() that determines the operator, maybe combo of both? how…

> It uses three different syntaxes; dot notation, curlies/brackets and colon key value.

Is it an issue? using symbols makes it easier to understand syntax.

> There is no distinction between noun "users" and verb "find".

Weird criticism from SQL. It can be distinguish by call with parenthesis.

IMO SQL keyword is harder to recognize.

Re: We Can Do Better Than SQL

#462

I love critiques of SQL about implementations of NULL. "NULL is so special that it's not equal to anything, not even itself!" Like, duh. WTF should NULL be equal to? Anytime I see people making this kind of argument about "doing better than SQL" I can immediately tell they are pretty much fucked in the head. Good luck, edgedb peeps. You haven't got a clue.

I am so completely unsurprised that people who don't understand the concept of undefined are telling me that it's actually defined.

Re: We Can Do Better Than SQL

#463
post #65

I love critiques of SQL about implementations of NULL. "NULL is so special that it's not equal to anything, not even itself!" Like, duh. WTF should NULL be equal to? Anytime I see people making this kind of argument about "doing better than SQL" I can immediately tell they are pretty much fucked in the head. Good luck, edgedb peeps. You haven't got a clue.

Maybe if you introduce the concept of a mathematically-principled empty set, you can do away the unprincipled concept of NULL. Empty set equals empty set.

Null isn't empty set.

Re: We Can Do Better Than SQL

#464

I love critiques of SQL about implementations of NULL. "NULL is so special that it's not equal to anything, not even itself!" Like, duh. WTF should NULL be equal to? Anytime I see people making this kind of argument about "doing better than SQL" I can immediately tell they are pretty much fucked in the head. Good luck, edgedb peeps. You haven't got a clue.

> WTF should NULL be equal to? In programming languages, NULL tends to be equal to itself. Why couldn't it be the same way in SQL?

No. That is not even close to being true. You're confusing None with NULL, like everyone else. Only a very few programming languages make this error.

NULL is undefined. It can't be equal or unequal to anything, including itself, for reasons that should be obvious.

Re: We Can Do Better Than SQL

#465

Earlier quoted context omitted.

> WTF should NULL be equal to? In programming languages, NULL tends to be equal to itself. Why couldn't it be the same way in SQL?

No. That is not even close to being true. You're confusing None with NULL, like everyone else. Only a very few programming languages make this error. NULL is undefined. It can't be equal or unequal to anything, including itself, for reasons that should be obvious.

> That is not even close to being true.

In C, NULL is equal to itself. In C++, nullptr is equal to itself. In Java, null is equal to itself. Same in C#. In JavaScript, null is equal to itself, and so is undefined.

> You're confusing None with NULL, like everyone else. Only a very few programming languages make this error.

Not so, as I've just shown.

SQL takes the philosophy that NULL isn't a value, but a marker for the absence of a value, and gives it special treatment so that it is not treated as equal to itself. Most programming languages do not take this approach, they instead treat null as a special value, special in that dereferencing it is disallowed, but it's still subject to the usual comparison rules (i.e. it's equal to itself).

Your contrasting of None again NULL isn't meaningful. They're just words. The semantics depend on the language.

> NULL is undefined

Depends on the language. In C it's defined as 0, roughly speaking. (Curiously the bit-pattern used to represent NULL is not required to be zero. [0])

As a curious aside, in C, the special float value NaN is not equal to itself.

[0] https://stackoverflow.com/a/9894047/

Re: We Can Do Better Than SQL

#466
post #384
post #31

Earlier quoted context omitted.

You can pry SQL out of my cold dead hands. Its just not that bad.

>>You can pry SQL out of my cold dead hands. Its just not that bad. I often joke that SQL is the COBOL of the 21st century. HHOS. There's worse things...e.g. COBOL. Actually it's very difficult to deny the empirically discernible utility of relational databases and SQL. SQLite, for example.

COBOL and SQL are for different purposes, apples and oranges. One can’t be worse than the other. Programmers who have never seen or written COBOL should stop trotting it out as an example of bad. You’d be surprised how many important systems are written in COBOL, and how well-suited it is for the problem domains it was designed for.
Post reply on HN