Martin Vajsar wrote:Sorry for playing the devil's advocate here, but have you ever heard about SQLJ?
I'm still not sure whether your issue with SQL is the relational algebra in itself, or the way SQL encapsulates it?
After all, it is just GRANT (rights) ON (objects) TO (dudes). All but the three keywords just name the objects.
Which better way of doing it would you imagine?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
No more Blub for me, thank you, Vicar.
Winston Gutkowski wrote:... because it was just yet another bolt-on to SQL.
... to design object contracts on the "tell, don't ask" premise ...
chris webster wrote:Well, it's true that more complicated stuff may require vendor-specific extensions to SQL
Many of your other points still seem to relate to taking a procedural stepwise approach to a non-procedural declarative language. I tend to approach hard queries more as a series of transformations, each yielding a new set of records that looks more like what I'm looking for.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Martin Vajsar wrote:You don't have to deal with the monstrosities (the ResultSet and PreparedStatement), but write static SQL instead which references Java variables directly. And get compile-time validation of static SQL queries, for-each and so on. Much, much better than JDBC - I don't understand why it didn't take off. Perhaps the idea of a pre-processor was just too gross when Java was still young?
![]()
I'm finally starting to see what are you talking about. Hibernate seems to be a way of addressing it. I'm not well versed in Hibernate and similar frameworks, though, so I don't understand their shortcomings, but I believe there are some.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:Top n is complex?
...lots of apps require process modelling as well - which is where OO came from.
My question is simply: why, after 30 years, haven't we come up with a better way of translating data (or perhaps, more specifically, databases) to procedure? Neither exists in a vacuum, and I want to tell my database what to do in my terms, and let it do it; not ask it what it's got and then plough through all the crap it gives me to work out HOW I'm going to do it. Now that's procedural.
Like I say: probably tilting at windmills.
No more Blub for me, thank you, Vicar.
chris webster wrote:No, and you're absolutely right that SQL could use more standardisation.
Pat Farrell wrote:I don't even know the word for the amount of data that Amazon or Google keep.
No more Blub for me, thank you, Vicar.
Pat Farrell wrote:I agree, we need a completely new approach to binding our big wads of data to our programming languages. And I really don't want it to be restricted to OO languages because I'm not convinced that OO will be important in a few decades.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
chris webster wrote:
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Winston Gutkowski wrote:you'll soon find out that most of them (and several more advanced people) spend a great deal of their time writing C code in Java
Pat Farrell wrote:This is one of the fundamental problems with OO.
At a high level, OO is just procedural code with some syntactical sugar on the data structures. Structs with methods and all that...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:Why hasn't SQL (or more likely, the databases that support it) caught up with the times? I don't care if an Oracle database ends up executing SQL behind the scenes, but don't force me to use it. It's also the ONLY correct place for it to be used, since it's the only place that needs it.
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
Paul Anilprem wrote:Well, the name is Structured query language. It is meant to query. It is meant to be "asked" not to be "told". Would you ask a coffee machine, why it doesn't wash your clothes??
If you want something like Java that allows you to write OO as well as procedural code...
you can use any other language that allows you to "query" as well as allows to "tell" and if that language doesn't do that well then you can fault it. I don't see any fault with SQL just because it is not amenable to doing something that it was not meant to do in the first place!
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Paul Anilprem wrote:Well, the name is Structured query language. It is meant to query.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Paul Anilprem wrote:Well, the name is Structured query language. It is meant to query. It is meant to be "asked" not to be "told". Would you ask a coffee machine, why it doesn't wash your clothes??
So, why are we forced to use it? Are you saying that something that has been designed by experts, and has (presumably) cost billions of dollars to implement over the years, has only ONE mode of access - SQL? And, furthermore, one that doesn't dovetail well with the things that are likely to want to access it? Sounds like an exercise in Machiavellianism if you ask me.
Winston Gutkowski wrote:
If you want something like Java that allows you to write OO as well as procedural code...
Erm...perhaps you missed the preamble, but Java is a procedural language. I don't think anybody (certainly not me) has argued otherwise.
you can use any other language that allows you to "query" as well as allows to "tell" and if that language doesn't do that well then you can fault it. I don't see any fault with SQL just because it is not amenable to doing something that it was not meant to do in the first place!
Now that is simply NOT true (at least not in the context of this argument).
Can I "tell" a database to add an new account for a client? Empirically. I assume you think I can.
Tell me: How would you do it with SQL?
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
Winston Gutkowski wrote:
Paul Anilprem wrote:Well, the name is Structured query language. It is meant to query.
Again: really? Then why does it have an UPDATE and INSERT command? To my mind, as a Java programmer, those are the ones that interest me most, because they might allow me to actually do something imperative. Sadly (as always) real life intervenes, and I'm pretty much forced to query before I update.
Winston
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
Winston Gutkowski wrote:Sadly (as always) real life intervenes, and I'm pretty much forced to query before I update.
Paul Anilprem wrote:That most databases support only SQL, is not SQL's fault. What has SQL got to do with it? Fault the database makers for not providing a language that you would like.
Why in the world would I ask my coffee machine to wash my clothes?
SQL is meant to deal with rows in a relational database. Why should it care about Accounts? If you want to deal with Accounts, try Object databases. Or something else, I don't know.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Paul Anilprem wrote:Well, the name is Structured query language. It is meant to query. It is meant to be "asked" not to be "told".
Martin Vajsar wrote:I'm far from being fluent in relational algebra, but on a few occasions I was able to arrive at an elegant SQL solution that displaced much more bloated procedural code. If the hypothetical new language offered good procedural code, but didn't provide all options supported by SQL, I wouldn't be happy with it.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Paul Anilprem wrote:That most databases support only SQL, is not SQL's fault. What has SQL got to do with it? Fault the database makers for not providing a language that you would like.
There is another? That is externally accessible? SQL is it AFAIK, so what else should I blame? It's the "public face" of the database....and, in procedural terms, it's crap.
Why in the world would I ask my coffee machine to wash my clothes?
Don't be absurd. I asked a perfectly valid question, and you come back with a non-sequitur?
SQL is meant to deal with rows in a relational database. Why should it care about Accounts? If you want to deal with Accounts, try Object databases. Or something else, I don't know.
Which, I hate to say, speaks volumes. Databases were (and ARE) presumably successful because they're very good at managing (note that verb) large volumes of data, structured in some way that makes sense to me, not just to database theorists.
So: My database better be darn sure it DOES care about Accounts if I tell it to.
Winston
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
Paul Anilprem wrote:Really sorry to waste everyones' bandwidth here but I really want to understand your point. So far, what I have understood is that you want to "tell" your db to add "account" using SQL and you are not able to do that. Your point is that that is why SQL is no good. Did I understand it correctly?
If so, my point is that why should expect something that was not meant to be procedural to be procedural? In that sense, why would I ask coffee maker to wash my clothes? Why is that analogy absurd?
Again, why is it important for you that SQL and RDBMS care about Accounts? RDBMS is there to manage relational data.
SQL is tool meant to manipulate that data. Now, I understand that you are not happy that it is not procedural enough. But then was meant to be procedural in the first place? Did it promise something that it failed to deliver?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Martin Vajsar wrote:I believe the issue is a lock-in. Especially in Java world, there is a lot of striving for database independence. If a single database comes up with a new, revolutionary interface, for years that interface will be a database specific code. Who'll write that code, if he can write a portable (though inelegant) SQL code instead?
And most importantly - if you use Oracle's NEXTVAL and CURRVAL sequence attributes correctly, you may not need to read the generated IDs at all.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Martin Vajsar wrote:Especially in Java world, there is a lot of striving for database independence.
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Jelle Klap wrote:
Martin Vajsar wrote:Especially in Java world, there is a lot of striving for database independence.
I never really understood that. It's seems great in theory, but in practice it can be severely limiting. An RDBMS isn't something you choose willy-nilly, it's a fundamental part of the system as a whole, you just don't arbitrarily swap it out for something else. It feels so over-engineered, just like wrappers, around wrappers, around wrappers for - wait for it - logging.
No more Blub for me, thank you, Vicar.
Jelle Klap wrote: An RDBMS isn't something you choose willy-nilly, it's a fundamental part of the system as a whole, you just don't arbitrarily swap it out for something else.
Jelle Klap wrote:It feels so over-engineered, just like wrappers, around wrappers, around wrappers for - wait for it - logging.
The JVM is one of the best things that has happened in computer science in the past few decades. Java the language, no so much.
Pat Farrell wrote:
Jelle Klap wrote: An RDBMS isn't something you choose willy-nilly, it's a fundamental part of the system as a whole, you just don't arbitrarily swap it out for something else.
Of course you don't swap it out arbitrarily, but sometimes you want to swap it out, say if Oracle buys up Sun which bought up a good open source database (MySql) and then announce that they are abandoning it so you can buy their grossly over-priced Oracle package. It could happen.
No more Blub for me, thank you, Vicar.
Pat Farrell wrote:Of course you don't swap it out arbitrarily, but sometimes you want to swap it out, say if Oracle buys up Sun which bought up a good open source database (MySql) and then announce that they are abandoning it so you can buy their grossly over-priced Oracle package. It could happen.
Martin Vajsar wrote: The application should work the same on MySQL as on Postgres, which is a true achievement, given that one uses lock-based concurrency and the other multiversioning. The net result is that the database is used just as a little bit more equipped file system.
No more fooling around. Read this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
|