Hacker News new | ask | show | jobs
by remotehack 3339 days ago
You don't like languages that the average human being can make sense out of but you do like Clojure? Did I read that right?

Then, "make them declarative and have software generate the diff". So you want the benefits of relational data without the pain, is that it? Why not use Hibernate like the oh so wise ones have told us to use only to now realize trying to bend relational tools into what a language designer's ideas are is maybe, probably, not the best idea after all and perhaps the reason that SQL and relational databases have withstood the test of time and Hibernate is on the road to death is that SQL and relational design were extremely, unabashedly well thought out and designed in the first place.

1 comments

You don't like languages that the average human being can make sense out of but you do like Clojure? Did I read that right?

You read that almost right. See, I don't think the average human who's fluent in English but not SQL will be able to properly understand anything but the most basic queries. Sure,

    SELECT * from users where username = 'remotehack';
is going to mostly make sense to the average person (but what's the * and ; for?), but then so will

    (select users (where {:username "remotehack"}))
The brackets won't make sense, of course, but we're talking about reading it, not writing, and they're not terribly important to that.

Now, give that same average person

    Select Distinct On (u.username, u.email)
         u.username
        ,u.email
        ,l.browser
        ,l.login_time
    From users u
    Join logins l On l.username = u.username
    Order By u.username, login_time Desc
and do you really think they'll have any idea what to expect that to return? This no longer reads like English.

And no, when I ask for declarative schemas, I'm not asking for ORM. I'm asking for a system where I say what the schema is instead of saying how to create it, just as I say what data I want rather than how to retrieve it. This is not incompatible with any of the fundamental concepts of relational databases.