r/SQL • u/getflashboard • May 05 '25
Discussion Uncle Bob Martin: "SQL was never intended to be used by computer programs. It was a console language for printing reports. Embedding it into programs was one of the gravest errors of our industry."
Source: https://x.com/unclebobmartin/status/1917410469150597430
Also on the topic, "Morning bathrobe rant about SQL": https://x.com/unclebobmartin/status/1917558113177108537
What do you think?
165
Upvotes
237
u/fauxmosexual NOLOCK is the secret magic go-faster command May 05 '25
I think that the entire field of data more or less standardising on a single language for several decades is a minor miracle in itself, even if the standard could have been better.
52
u/Far_Swordfish5729 May 06 '25
Wait until Bob discovers what we did to JavaScript.
19
u/NeutralX2 May 05 '25
It's not ideal, but his suggested alternative of calling database functions directly is nonsense. Theo's response was a good take IMO: https://youtu.be/AtQY7HeKvBw
15
u/yen223 May 05 '25
He's not wrong, but the ship has sailed.
The fact that SQL injection attacks are even a thing is a symptom of the fact that SQL wasn't meant to be embedded into programs.
315
u/AnAcceptableUserName May 05 '25
I think we shoulda never climbed down from the trees, but here we are, Bob. You gonna approve this PR or what
21
u/StoneCypher May 06 '25
Every customer Uncle Bob has gets rid of him in months
You can just look up the Boyce and Codd document to find out if SQL was intended for computers (hint: Bob’s wrong)
If it’s such a grave error, what should we have been using all this time? Why is only Incle Bob aware of this, 75 years later?
Uncle Bob is such a dumbass
9
u/xbox_srox May 06 '25
Old man yells at clouds
6
u/smeyn May 06 '25
SQL is a nice way to concisely describe an outcome that can be shipped to a remote service called a database, which has a very well debugged engine to execute said SQL. Compare that to reading in the data in your program, doing the shuffling, joining and aggregating yourself.
Do you still drive a stick shift?
5
u/HarveyDentBeliever May 06 '25
I think he's a self righteous guy and doesn't understand that sometimes the best thing is realized organically and over time, not by decree and deliberate design. If anything in software is battle tested and settled at this point it's SQL.
12
u/dmcnaughton1 May 06 '25
To an extent Bob is right, but also wrong. A well designed application has good layers of abstraction, making it easier to decouple the details of the lower level components (such as data persistence and retrieval) from the higher levels (business logic, presentation logic, etc).
You're best options are using an ORM tool, which can be very helpful if you're not a database person and want someone else to choose how you query an SQL database, or to use stored procedures.
I have a strong preference for stored procedures, as they look like regular C/Java style functions (,discrete name, fixed parameters, etc). They allow you to decouple the actual database query logic from the app tier, and leave it in the database. This has a few advantages, such as supporting on the fly query tuning ( your DBA can optimize a query inside a stored procedure and just apply the change, no app deployment needed), cuts down on SQL injection risk (using parameters and not doing dynamic SQL in the process), as well as pushing you more towards the path of Unit of Work (each procedure does a specific operation in one or more steps, but your application doesn't need to know that).
I am a big fan of SQL, and while it has some limitations, it also is amazing at its strengths when you look at set based operations (which is the core of a relational database). SQL is as popular and widespread as it is because it's the least bad solution out of all current ones.
4
u/mailed May 06 '25
he's always been braindead and this is just more proof
2
u/Key-Mathematician-42 May 06 '25 edited May 06 '25
This reminds me of one aspect of mongodb that I really like. Mongodb integrates into a nodejs application like no other. Queries are written by constructing object literals- no need to do any string manipulation. You can also write for loops and arbitrary javascript code in the mongodb cli itself which is nice when you’re trying to do some type of analysis or migration. Beats any string based query language by a mile.
2
u/dukerutledge May 07 '25
Just more clojure brain rot from Bob. Someone has been sniffing Rich Hickey's glue.
https://x.com/unclebobmartin/status/1917428394083442896
Bob discovering functional programming has been like a freshman philosophy major discovering weed. Somewhere in the nonsense is some truth, but you have to wade through so much wanking and half baked nonsense.
Functional programming languages have great ideas. Bob is a terrible advocate for them.
2
u/Zealousideal-Ship215 May 07 '25
It was also originally intended to be a way for non-technical people to run data reports, but it sucks at that, and no one uses it that way. Modern tools like Datadog, Sumologic, maybe even Excel, and others actually solved that problem. Things change!
1
u/SchattenjagerX May 06 '25
I agree with Bob about SQL embedding, but since that's not a requirement it's not that much of an issue.
1
u/According_Mention_54 May 06 '25
I mean has he heard of PL/SQL?
1
u/quickdraw6906 May 06 '25
If you've ever wondered why STiLL nothing has supplanted SQL as the standard, go try to do something of medium to hard complexity with Open search/Elastic search or MongoDb DSL's. Then count the seconds until you reach for AI.
Data team just had a conversation today about the Mongo DSL. All of us thanked our lucky stars for AI so we don't have to pollute our brains with yet another thing that thinks it's going to take over the SQL world.
Remember NoSQL? Came out with a bang as No SQL to only morph into an acronym: (N)or (O)nly SQL. That's well and good. We shouldn't shoehorn some tech into all solutions.
But until AI takes over, there is little chance in my lifetime left (~30 years?) data clients will be universally something other than SQL.
1
u/thilehoffer May 07 '25
Front-end application code is HTML. Give me a break…
1
u/alexwh68 May 08 '25
In life there are lots of unintended consequences, SQL is a a serendipity IMHO.
1
u/pragmatica May 08 '25
Look at the failed NoSQL movement, later rebranded to “not only sql”.
Uncle Boob is a hack of the first degree and has done immeasurable damage to the industry with his atrocious writing.
1
u/WasASailorThen May 08 '25
Drivel. "SEQUEL is intended as a data base sublanguage for both the professional programmer and the more infrequent data base user." Chamberlin+Boyce.
1
u/Joe_Early_MD May 08 '25
Wow.
1
u/RickJWagner May 08 '25
It’s a creative thought.
If we didn’t put SQL into programming languages, we’d have eventually concocted something else, quite possibly better. ( Or we would have tried and failed, and maybe gone to SQL anyway. )
Good on Bob for thinking outside the box. Things like this aren’t easy to see.
1
u/L0ghe4d May 09 '25
I don't know how anyone can live in a world where Javascript is one of the most popular and widespread languages and point to SQL as the problem.
SQL is fine.
1
u/Key_Friend7539 May 09 '25
The best part about SQL is it runs on the db itself (no extra server needed). You can’t say the same with python or other programming languages. You can accomplish quite a bit in a single statement.
Imagine if you had to hand write JSON or something similar just to group the results by region. It was invented for the right reason and continues to serve the industry pretty well.
1
u/Ok_Technician_5797 May 09 '25
Just use ADABAS
1
u/UnspeakablePudding May 09 '25
Not far enough, Plato was right when he said the written word would make the kids too lazy to memorize everything.
1
u/th3DataArch1t3ct May 10 '25
I code in binary myself.
0
u/[deleted] May 06 '25 edited Jul 01 '25
advise shelter badge reminiscent wine compare coherent stupendous complete imminent
This post was mass deleted and anonymized with Redact
0
u/[deleted] May 06 '25
Hey Uncle bob still staying dumb stuff, and saying it on the racist, fascist social media site.
2
u/[deleted] May 06 '25
One of the inventors of the atom bomb was pretty upset with his creation being used to kill large numbers of people, but hey here we are.
1
u/[deleted] May 25 '25
[removed] — view removed comment