Hacker News new | past | comments | ask | show | jobs | submit login

All of the ReQL examples are completely unreadable relative to SQL.

Because SQL is very familiar and ReQL is not.




I think it's more because the javascript-with-callbacks is chatty and ugly. But you can also write it in a more stream-like style. I have no idea why so many examples out there use the nastier style. An example stolen from another commenter:

  r.table('users').filter(r.row('age').gt(30))


> I think it's more because the javascript-with-callbacks is chatty and ugly.

We did the best we could with JavaScript. IMO the Ruby implementation of ReQL is dramatically more beautiful. Ruby's blocks fit so well that we don't even provide the `r.row` shortcut in ruby:

  r.table('users').filter{|row| row['age'] > 30}


With ES6:

  r.table('users').filter(row => row('age').gt(30))


You only write javascript if you're using javascript ;)

If you python you use python's native constucts, which if you use python you're naturally familiar with.

    r.table('users').filter(r.row['age'] > 30)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: