Live data from Hacker News

Learn SQL Once, Use It for 30 Years

fagnerbrack.com

81–90 of 243 posts

Re: Learn SQL Once, Use It for 30 Years

#81

The comparison with JavaScript as an exemplary imperative language is silly. You can find examples of C code from 40 years ago that still work perfectly with modern compilers. Like C, SQL is a technology that has far outlived its usefulness, though, for very different reasons. SQL was not designed for application development, and every attempt to integrate it into higher level programs (ORM, fluent query builders, ra…

> Learning relational modelling is great, but learning SQL itself, unless you actively have to work with it, is a waste of time. What a wild statement. SQL is one of the most useful tools ever developed, as evidence that it's BY FAR the most widely used programming language in the world. The idea that it is an ABSOLUTE LAST RESORT that should never be used unless you ABSOLUTELY HAVE TO is insane...

Even wilder:

> SQL was not designed for application development, and every attempt to integrate it into higher level programs (ORM, fluent query builders, raw strings, macros/preprocessors) comes with unpleasant rough edges.

Forgetting that interactive SQL queries, and to an even greater degree the underlying databases, are applications.

Re: Learn SQL Once, Use It for 30 Years

#82
post #21

Earlier quoted context omitted.

Once you break free of ORM’s I find the code so much simpler to maintain. Here’s the query(typically multiple different subqueries and return types), here’s the params, give me all the data back and something like Dapper in .net is an absolute godsend to convert it.

The code is simple to maintain until the database changes. Then you will experience the pain of SQL

I’ve experienced what you’ve mentioned before, ORM or not you have issues if you’re shuffling the schema around.

Cool.

Re: Learn SQL Once, Use It for 30 Years

#84

Earlier quoted context omitted.

> Learning relational modelling is great, but learning SQL itself, unless you actively have to work with it, is a waste of time. What a wild statement. SQL is one of the most useful tools ever developed, as evidence that it's BY FAR the most widely used programming language in the world. The idea that it is an ABSOLUTE LAST RESORT that should never be used unless you ABSOLUTELY HAVE TO is insane...

Even wilder: > SQL was not designed for application development, and every attempt to integrate it into higher level programs (ORM, fluent query builders, raw strings, macros/preprocessors) comes with unpleasant rough edges. Forgetting that interactive SQL queries, and to an even greater degree the underlying databases, are applications.

Anyone who hates SQL typically is completely clueless how hard it is to actually do what SQL does correctly and efficiently.

SQL makes doing something that is VERY hard stupidly easy.

Re: Learn SQL Once, Use It for 30 Years

#85
post #21

Earlier quoted context omitted.

Once you break free of ORM’s I find the code so much simpler to maintain. Here’s the query(typically multiple different subqueries and return types), here’s the params, give me all the data back and something like Dapper in .net is an absolute godsend to convert it.

The code is simple to maintain until the database changes. Then you will experience the pain of SQL

Data schema changes are difficult, almost regardless of technology - it's been an issue for me from relational dbs to OpenAPIs. gRPC is easier as long as you obey the migration rules, but those impose tight restrictions on what you can change

Re: Learn SQL Once, Use It for 30 Years

#86

The comparison with JavaScript as an exemplary imperative language is silly. You can find examples of C code from 40 years ago that still work perfectly with modern compilers. Like C, SQL is a technology that has far outlived its usefulness, though, for very different reasons. SQL was not designed for application development, and every attempt to integrate it into higher level programs (ORM, fluent query builders, ra…

The point is that you will actively have to work with it. If you are designing data intensive applications without sql you are the exception, not the rule.

Re: Learn SQL Once, Use It for 30 Years

#87
post #30

> If you are a junior developer, “learn SQL properly” is the most valuable 40 hours you can spend. Not a tutorial. Not an ORM. Actual SQL: joins, subqueries, window functions, query plans. That investment pays you back at every job, in every stack, for decades This is the power of low-level reasoning. Today, even for a junior developers, even if they have AI that solves syntax problems, SQL teaches you to reason and…

That’s not low-level reasoning, but rather low-resolution thinking. SQL is a high level language. It’s so high level that you barely need to express how the computer should do things, but only declare what you want to have.

Re: Learn SQL Once, Use It for 30 Years

#88
My first job in 1994 was using RDB, very soon updated to RDB-Oracle 6 that was very compliant with my book about sql 92. I learned SQL during my studies, so my queries based on joins naturally performed well, unlike the nested SELECT statements in the legacy code. I learned to tune performances. After that, I've encountered Oracle with its share of non-standard syntax and behavior. Now, when I build a backend (flask or fastapi), my CLAUDE.md contains "use sqlite without sqlalchemy" so that I can understand how data is accessed and check that there is no hidden query inside a loop. When the SQL queries generated by AI become unreadable, it’s a sign that the system is no longer functioning properly. In my view, SQL is a good way to maintain control over an application that is largely generated by AI.

Re: Learn SQL Once, Use It for 30 Years

#89
post #56
post #31

Earlier quoted context omitted.

There is no SQL successor: SQL is here to stay. Applying the Lindy effect [1]: after half a century of SQL we can expect it to survive for at least as long. Disruption/displacement of SQL is like attempting to replace email. It's not going to happen. At best an alternative technology can carve out a small niche (and there's nothing wrong with that). [1]: https://en.wikipedia.org/wiki/Lindy_effect

That wikipedia article was super interesting, I'd never heard of the Lindy Effect before. A bit difficult to wrap my noggin around but really fascinating to think about.

Read the books of Nassim Taleb. They are full of this kind of interesting stuff. Sadly, he blocked me on twitter back when I asked him why he had a paid subscription for a self-described communist hardcore-Putinist hardcore-Antisemite :/

Re: Learn SQL Once, Use It for 30 Years

#90
This is standard advise I give to any IT consultants (incl some that didn't ask for any lol). Cos I see too many of them evolving into purchasing clerks and postmen, far removed from the tech and operations.

Regex, SQL, Basic linux command line tools, awk. More as job demands.

Post reply on HN