4 ms·
> 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/bra
by njharman 6y ago
> 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 do I do other operations.
.Only if you are familiar with programing language that has that same syntax does any of it make sense. Otoh even educated non-programmers are gonna be able to read the SQL as SELECT "these things" FROM "this table" WHERE "these conditions are true".
- doubletgl 6y ago> Only if you are familiar with programing language that has that same syntax does any of it make sense. I'd argue that most relational DB users are familiar with a programming language, and therefore most likely familiar with the C-style syntax. It's better to build on something that most of the potentials users are familiar with already. > There is no distinction between noun "users" and verb "find". There is no such distinction in natural language either (if you see words purely as sequences of characters), you have to know what is what and infer it from the context. > even educated non-programmers are gonna be able to read the SQL as SELECT "these things" FROM "this table" WHERE "these conditions are true". Yeah SQL looks a bit more like natural language at first glance, but that's about it. That familiarity is a false friend, it doesn't really help with the learning curve. This kind of thinking reminds me of the ruby community trend a decade ago when DSLs were created to look beautiful and like written language. It's useless and confusing for long-term, practical purposes. Same with BDD style testing languages. The promise that non-technical people will feel right at home and can start contributing rarely lives up to reality.
- 013a 6y agoWhy would you want your query language to read like English? Most people don't speak English.
- IHasFingers 6y agoI don't think SQL would be better if it read like Mandarin.
- fomine3 6y ago> 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.