Preferences

You're joking but it's true. I'm sure you know that. SQL had similar claims... Declarative, say what you need and the computer will do for you. Also written in English.

And compared to what we had before SQL, it is much easier to use, and a lot more people are able to use it.
noworriesnate
But software developers often struggle to use sql and prefer using ORMs or analytical APIs like polars; the people who excel at sql are typically not programmers, they’re data engineers, DBAs, analysts, etc.

Maybe a similar bifurcation will arise where there are vibe coders who use LLMs to write everything, and there are real engineers who avoid LLMs.

Maybe we’re seeing the beginning of that with the whole bifurcation of programmers into two camps: heavy AI users and AI skeptics.

ruszki
What you can achieve with the standard SQL is taught on universities. The whole package. I’ve never met a developer, who struggled with that. When you use ORMs you need to follow SQL’s logic anyway. People use ORMs to avoid painful data conversions. Not to avoid the logic. Data engineers, DBAs, analysts, etc excel in specific databases, not in “SQL”.
FranzFerdiNaN
Ive worked in BI and data engineering my whole career and I’ve met plenty of programmers who struggled immensely with SQL once it went further than select and group by. And don’t get me started about their database design skills. It’s way too often a disaster hidden behind “it works for the software so good enough”.

Im more surprised by software engineers who do know these things than by the ones who don’t.

maccard
I’ve worked with gameplay programmers who can’t do simple 3D math, c++ programmers who fundamentally don’t understand pointers, backend developers who didn’t understand globals were shared state and cause race conditions, etc.

It’s not that SQL is hard, it’s that for any discipline the vast majority of people don’t have a solid grasp of the tools they’re using. Ask most tradespeople about the underlying thing they’re working with and you’ll have the same problem.

adalacelove
I'm a developer and: - I hate ORMs, they are the source for a lot of obscure errors behind layers and layers of abstractions. - I prefer analytical APIs for technical reasons, not just the language.

Reasons: - I can compose queries, which in turn makes them easier to decompose - It's easier to spot errors - I avoid parsing SQL strings - It's easier to interact with the rest of the code, both functions and objects

If I need to make just a query I gladly write SQL

Well, the problem in ORM is the O. Objection-orientation is just a worse way to organise your data and logic than relational algebra.

It's just a shame that many languages don't support relational algebra well.

We had relations as a datatype and all the relevant operations over them (like join) in a project I was working on. It was great! Very useful for expressing business logic.

The problem in ORM is the M, the mapping is always lossy and a leaky abstraction.
idiotsecant
'real' engineers can use SQL just fine. This is a strange position to take.
collingreen
No true Scotsman would struggle with sql
idiotsecant
Are you saying that expecting software developers to know how to use SQL is a no true scotsman fallacy? What's next? Do we stop expecting people to know how FOR loops work?
collingreen
Do you think that's where I'm going with that? Expectations for people and for loops?

> 'real' engineers can use SQL just fine.

To be very explicit instead of snarky about my point: I think it is both factually incorrect and unnecessary gatekeeping to say real engineers know sql and imply not knowing sql marks someone as not a real engineer, hence the "no true Scotsman" fallacy.

I probably agree with most of your opinions here within the context of the thread - I think good engineers can learn sql and other tools as necessary. I don't, however, think experience with any particular technology is a valid bar for a good or bad engineer at this point and I'm happy to speak against that when I see it.

atomicnumber3
Aren't data engineers programmers? That is to say, a data engineer is-a software engineer?

I share your sentiment though - I'm a data engineer (8 years) turned product engineer (3 years) and it astounds me how little SQL "normal" programmers know. It honestly changed my opinion on ORMs - it's not like the SQL people would write exceeds the basic select/filter/count patterns that is the most that non-data people know.

sanderjd
> But software developers often struggle to use sql

Is this true? It doesn't seem true to me.

winnie_ua
Oh, sweet summer child.

Yes, there are so many so called developers in backend field of work who do not know how to do basic SQL. Anything bigger than s9imple WHERE clause.

I wouldn't even talk about using indexes in database.

sanderjd
I've been doing this for over fifteen years. I haven't ever worked with anyone who is good at the job in general but can't figure out SQL.
nathanfig
Claude made this point while reviewing my blog for me: the mechanization of farms created a whole lot more specialization of roles. The person editing CAD diagrams of next year's combine harvester may not be a farmer strictly speaking, but farming is still where their livelihood comes from.
dredmorbius
Strictly speaking, farming is where all our livelihoods come from, in the greatest part. We're all living off the surplus value of food production.

(Also of other food, energy, and materials sourcing: fishing, forestry, mining, etc.)

This was the insight of the French economist François Quesnay in his Tableau économique, foundation of the Physiocratic school of economics.

You might find https://en.wikipedia.org/wiki/Margarine#Coal_butter fascinating.

> Strictly speaking, farming is where all our livelihoods come from, in the greatest part. We're all living off the surplus value of food production.

I don't think farming is special here, because food isn't special. You could make exactly the same argument for water (or even air) instead of food, and all of a sudden all our livelihoods would derive ultimately from the local municipal waterworks.

Whether that's a reductio ad absurdum of the original argument, or a valuable new perspective on the local waterworks is left as an exercise to the reader.

lipowitz
Removing jobs that could only be performed by those living near the particular fields with those that can be done anywhere makes jobs for the person willing to take the least satisfactory compensation for the most skill and work.

Working the summer fields was one of the least desirable jobs but still gave local students with no particular skills a good supplemental income appropriate for whichever region.

miki123211
depending on the job, it may also allow you to select for talent much better, which creates intense competition and raises salaries significantly.

A good example of this phenomenon is sports. Even thought it can't be done remotely, it's so talent dependent that it's often better to find a great player in a foreign country and ask them to work for you, rather than relying exclusively on local talent. If it could be a remote job, this effect would be even greater.

Yes, but automating these away means that food becomes cheaper.

We increase the overall total prosperity with that automation.

swader999
Land is scarce though. The amount of software work that needs doing might not be, it could be infinite or probably more tied to electrical capacity.
downrightmike
They're all real programmers John
ameliaquining
Is that really because of the English-esque syntax, rather than because it was a step forward in semantic expressivity? If SQL looked like, say, C#'s LINQ method syntax, would it really be harder to use?
> Is that really because of the English-esque syntax

Well, what we had before SQL[1] was QUEL, which is effectively the same as Alpha[2], except in "English". Given the previous assertion about what came before SQL, clearly not. I expect SQL garnered favour because it is tablational instead of relational, which is the quality that makes it easier to understand for those not heavy in the math.

[1] Originally known as SEQUEL, a fun word play on it claiming to be the QUEL successor.

[2] The godfather language created by Codd himself.

dmkolobov
Do you have any advice for understanding the difference between "relational" and "tablational"? I remember hearing something about how SQL is not really relational from my college professor, but we never really explored that statement.
Quite simply: A relation is a set of tuples, while a table is a list/multiset of tuples.

The Alpha/QUEL linage chose relations, while SQL went with tables. Notably, a set has no ordering or duplicates — which I suggest is in contrast to how the layman tends to think about the world, and thus finds it to be an impediment when choosing between technology options. There are strong benefits to choosing relations over tables, as Codd wrote about at length, but they tend to not show up until you get into a bit more complexity. By the time your work reaches that point, the choice of technology is apt to already be made.

With care, SQL enables mimicking relations to a reasonable degree when needed, which arguably offers the best of all worlds. That said, virtually all of the SQL bugs I see in the real world come as a result of someone not putting in enough care in that area. When complexity grows, it becomes easy to overlook the fine details. Relational algebra and calculus would help by enforcing it. But, tradeoffs, as always.

razakel
Per the SQL specification:

>SQL [...] is a database language [...] used for access to pseudo-relational databases that are managed by pseudo-relational database management systems (RDBMS).

>SQL is based on, but is not a strict implementation of, the relational model of data, making SQL “pseudo-relational” instead of truly relational.

>The relational model requires that every relation have no duplicate rows. SQL does not enforce this requirement.

>The relational model does not specify or recognize any sort of flag or other marker that represents unspecified, unknown, or otherwise missing data values. Consequently, the relational model depends only on two-valued (true/false) logic. SQL provides a “null value” that serves this purpose. In support of null values, SQL also depends on three-valued (true/false/unknown) logic.

Or, in other words, "relation" does not mean the relations between the tables as many assume: the tables, as a set of tuples, are the relations.

AdieuToLogic
Before SQL became an industry standard, many programs which required a persistent store used things like ISAM[0], VISAM (a variant of ISAM[0]), or proprietary B-Tree libraries.

None of these had "semantic expressivity" as their strength.

> If SQL looked like, say, C#'s LINQ method syntax, would it really be harder to use?

Yes.

0 - https://en.wikipedia.org/wiki/ISAM

charlieyu1
Don’t think the person was joking. It was literally the promise of COBOL
Er, have you heard of datalog or Prolog? Declarative programming really does work. SQL was just... Botched.
glimshe OP
Yes. And I think SQL is actually pretty good for what it does. My point, as the parent's (I suppose) is that we've heard this "XYZ, which uses natural language, will kill software development" before.
sanderjd
I think SQL is better than datalog. I suspect this is one of those opinions that may be somewhat outside consensus on a forum like HN, but is strongly within the consensus more broadly.
aeonik
I like both, they excel at different things.

SQL is pretty horrifying when you start getting tree structures or recursive structures. While Datalog handles those like a champ.

SQL is really nice for columnar data, and it's well supported almost everywhere.

Though Datalog isn't half bad at columnar data either.

sanderjd
Yeah. I think you and I have the same opinions about this :)

I like SQL more when working with tabular data (especially for analytical use cases), but that has (thus far) dominated the kinds of work I've done.

kayodelycaon
SQL and many DSLs (JIRA…) are actually used by plenty of non-technical users. Anyone who wants to build their own reports and do basic data analysis has sufficient incentive to learn it.

They are very much the exception that proves the rule though.

dredmorbius
I'd long ago (1990s-era) heard that the original intent was that office secretaries would write their own SQL queries.

(I'd love for someone to substantiate or debunk this for me.)

rsynnott
That's always the promise of these things; non-specialists will be able to program now! This has been going on since COBOL. The one case where it arguably worked out to some extent was spreadsheets.
bluGill
Anyone with complex spreadsheets (which is a lot of companies) has a few programmers with the job of maintaining them. The more training those people have in "proper programming" the better the spreadsheets work.
jimbokun
I would say that failed with SQL but succeeded with Excel. If you replace "office secretaries" with "office workers" in general.
ahmeneeroe-v2
It kinda came true. "Office secretaries" became PMs/junior analysts/etc and those people generally know basic SQL nowadays
gsinclair
I heard that from a lecturer too. It really stuck in the memory.
bazoom42
Early on, programming was considered secretarial work.
AdieuToLogic
> Early on, programming was considered secretarial work.

Incorrect.

Encoding a program was considered secretarial work, not the act of programming itself. Over time, "encoding" was shortened to "coding."

This is why the industry term "coder" is a pejorative descriptor.

> This is why the industry term "coder" is a pejorative descriptor.

For some people some of the time. I don't think that's true in general.

0points
> This is why the industry term "coder" is a pejorative descriptor.

It is not.

brabel
It used to be widely seen as such. See for example Stallmanns latest post where he mentions that. Coder was not the same as programmer, it was the lesser half of the job. Nowadays the term has lost its original meaning.
Or QBE, "Query By Exemple", that was another try by IBM to make a query language directly usable by anyone.

This item has no comments currently.