NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
Learn SQL Once, Use It for 30 Years (fagnerbrack.com)
wodenokoto 4 hours ago [-]
I think the pretext of this articles is ridiculous.

Yes, SQL is based around relational algebra, but all programming languages are built on a theoretical foundation.

And SQL is very much a "fad" language - it just somehow managed to stick around. The goal was not some sort of mathematical purity, but rather to built a natural language data interface (sounds like something currently very hyped?) and it failed spectacularly at that goal.

It is so far from natural language that English speakers with statistical understanding won't be able to read it, but it is also inconsistent enough in its grammar design that it is unreasonably difficult to learn and needs large refactoring every time you want to query into the result of a query.

To continue my rant: Sometimes '=' is an identity test, sometimes it is `==`. Sometimes groups are called groups, sometimes they are partitions.

When creating a CTE, you put the name before "AS", but when creating a column, you put the name after "AS".

SQL is great because it is everywhere and it is definitely good enough, but it is not something great, that transcends other programming languages.

gonzalohm 1 hours ago [-]
SQL may not be perfect, but I think the biggest pain points come from databases themselves. Any changes to the table structure (like a simple column rename) breaks all your queries. Data versioning not supported. Documentation not supported out of the box...
datsci_est_2015 22 minutes ago [-]
I think this is a tad too contrarian. I think SQL does (did?) a great job of giving common-language terms for fundamental data table operations, which in turn creates a shared mental model that everyone can use to describe what can and should be done to tables.

I agree with you in terms of syntax, though, it leaves something to be desired. But learning SQL was a pretty fundamental step in my journey to becoming a data scientist. It helped form the basis for how I reason about tabular data.

onlyrealcuzzo 1 hours ago [-]
> And SQL is very much a "fad" language - it just somehow managed to stick around.

Probably because - despite it not being perfect - the only people who have been able to do it better are very slight variations of it like LINQ and Logica and GoogleSQL etc.

flossly 4 hours ago [-]
I found PRQL[1] to be good fix for nearly everything I dont like about SQL.

But then it's only a query lang (DDL you still do in SQL then I guess).

Bottom line for me now is that I dont write much of my SQL by hand. AI does a much better job at it. I just read it back and point out mistakes and/or inefficiencies.

1: https://prql-lang.org/

heisgone 18 minutes ago [-]
This looks somewhat similar to LINQ in how it order clauses.
fauigerzigerk 2 hours ago [-]
>Yes, SQL is based around relational algebra, but all programming languages are built on a theoretical foundation.

While true on some level, I don't think this is a very useful statement. The importance of mathematical foundations lies in the extent to which they constrain the features of a programming language.

That extent is not the same for all languages. Many programming languages do not appear to be constrained by anything other than some pragmatic hunch of their designers plus the theoretical limits of computability.

SQL is a mess. The author acknowledged that. But the relational model and relational algebra are more serious attempts at creating a small but expressive theory than many of our mainstream programming languages.

ale 2 hours ago [-]
Well put. SQL gets put in this category of foundational technology that has passed the test of time when in reality it’s more like an example of path dependence.
aledevv 5 hours ago [-]
> 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 approach problems logically. Without any wrapper masking low-level logic.

It's something like the letters of the alphabet that form concepts: why should they change?

flossly 3 hours ago [-]
I find SQL a very thick "wrapper masking low-level logic". Think of the query planning, the index-maintaining, the upholding of guarantees, the writing-to-disk and caching that you are all not doing by using a RDBMS!

I'd say SQL is a very high level language.

"SQL teaches you to reason and approach problems logically" -- I kind of agree here. It teaches relational data mgmt. I think it is better to attack most software design challenges at a higher level, and --once settled at that level-- consider how to "serialize" those solutions to an RDBMS (if that's the tech that you've chosen for persistence; still a very solid choice after 50+ years!).

jasode 4 hours ago [-]
>, SQL teaches you [...] Without any wrapper masking low-level logic.

I understand the point you're trying to make, and yes, it does seem like SQL is "low-level" from the perspective a wrapper like ORMs or a GUI db browser tool with menus for filtering data.

But it's also worth remembering that SQL itself is a high-level wrapper that hides the lower-level C/C++ code of the db engine that has the loops that iterate through b-trees, 8k data pages, memory blocks of the buffer cache, etc.

And C/C++ itself is a high-level wrapper that hides the logic in lower-level Linux o/s system calls that manages RAM and disk i/o.

And Linux itself is a high-level wrapper that hides low-level device drivers like SATA/SSD memory-mapped IO ... and so on and so on.

Depending on the type of app, you can ignore all the lower levels and just work at the abstraction level of higher-level wrappers.

nkmnz 39 minutes ago [-]
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.
qohen 5 hours ago [-]
A couple of sites worth checking out to level up, both by Markus Winand:

https://modern-sql.com/

https://use-the-index-luke.com/

oulipo2 5 hours ago [-]
also a few different para-sql languages that can be useful, to lower the complexity:

- https://prql-lang.org/ - https://www.malloydata.dev/

psychoslave 2 hours ago [-]
The whys will vary, but letters of alphabets do change indeed.
3 hours ago [-]
TonyAlicea10 2 hours ago [-]
I’d say the most impactful thing is not to learn SQL, but set theory.

Well-written SQL is about thinking in sets. I cannot tell you how many poorly written procedural stored procedures I’ve replaced with a single performant SQL query over the years.

This is because the most impressive part of the SQL ecosystem is the DBMS engine’s query plan. Though, yes, you have to know how to influence it.

I find ORMs also tend to keep devs thinking procedurally.

Yes learn SQL! But don’t just learn the syntax. Learn the underlying mathematical models and ways of thinking that SQL supports implementing.

teleforce 3 days ago [-]
>The Only Programming Language Built on Mathematics, Not Fashion

As a modern array language D4M is the natural successor for SQL [1].

D4M is based on mathematics like SQL, specifically associative array algebra but not relational unlike SQL. It's more generic since can it caters to most modern data abstractions including spreadsheets, database tables, matrices, and graphs [2].

You can achieve 100M database inserts per second with D4M and Accumulo more than a decade ago back in 2014 [3].

[1] D4M: Dynamic Distributed Dimensional Data Model:

https://d4m.mit.edu/

[2] Mathematics of Big Data: Spreadsheets, Databases, Matrices, and Graphs:

https://direct.mit.edu/books/monograph/5691/Mathematics-of-B...

[3] Achieving 100M database inserts per second using Apache Accumulo and D4M (2017 - 46 comments):

https://news.ycombinator.com/item?id=13465141

molf 5 hours ago [-]
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

Hugsbox 3 hours ago [-]
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.
nkmnz 36 minutes ago [-]
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 :/
aargh_aargh 2 hours ago [-]
First impressions assuming the goal is to replace the incumbent SQL. Haven't seen the language yet.

  * D4M rolls off the tongue
  * Make me buy a book to see the language.
democracy 5 hours ago [-]
The power of SQL is not because it is "based on mathematics" - it's because anyone (really, anyone, even with the most basic English skills) could understand it quickly enough to start using it productively with not much technical knowledge. Business analytics, managers of all sorts, manual QA people could grasp the basics in a minute and more complex queries within a few hours. It is very user-friendly and such tools win over anything else. Each time I see an overengineerd/overcomplicated solution that is hard to read/understand - I know it's only "good luck" to the creators.
red_admiral 5 hours ago [-]
The only one? As opposed to ... Haskell, LISP/Scheme in the original SICP version, and proof assistant languages like Lean.
ndsipa_pomu 5 hours ago [-]
Sounds interesting, but how can I use it to talk with an Oracle/MySQL/PostgreSQL database?
l1ng0 5 hours ago [-]
I feel you missed the point of the article :)
kibibu 5 hours ago [-]
I feel like the point of the article was "hey chatgpt write me an article about SQL"
reacweb 38 minutes ago [-]
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.
mightyham 2 hours ago [-]
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, raw strings, macros/preprocessors) comes with unpleasant rough edges. The best thing young developers can do is read a book like "Designing Data-intensive Applications" and learn how the fundamental technology behind databases work. Learning relational modelling is great, but learning SQL itself, unless you actively have to work with it, is a waste of time.
onlyrealcuzzo 1 hours ago [-]
> 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...

HelloNurse 1 hours ago [-]
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.

Pavilion2095 2 minutes ago [-]
The issue is that most of these tools try to reinvent the wheel. Instead of using sql, you use 'fluent builders' or whatever, and they have their own tricks and cevats.

Sqlc is the best thing I've personally used because it produces models and repositories based on plain sql queries.

onlyrealcuzzo 55 minutes ago [-]
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.

hilariously 44 minutes ago [-]
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.
WA 7 hours ago [-]
- I recently read that most programmers SQL knowledge is outdated by 20 years and it’s true for me. There are quite a lot of features in most DBs that feel very "new" to me.

- Comparing SQL to React weakens the argument. SQL is the language, React is a piece of software. You certainly can run 30 year old JS today in modern browsers.

ciconia 6 hours ago [-]
I've been slowly transitioning from using an ORM to just plain SQL. It's so much simpler. Less magic, more explicitness, and more control. Also, much better performance. I think the thing is to construct your model around the different queries you need to perform. In many cases, especially a CRUD-type situation, you'll end up with 10-20 different SQL queries, and that's it.
grebc 6 hours ago [-]
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.

gonzalohm 2 hours ago [-]
The code is simple to maintain until the database changes. Then you will experience the pain of SQL
bbkane 44 minutes ago [-]
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
grebc 1 hours ago [-]
I’ve experienced what you’ve mentioned before, ORM or not you have issues if you’re shuffling the schema around.

Cool.

vbezhenar 5 hours ago [-]
That's true. SQL knowledge is one of the few skills that didn't age.

1. C language.

2. *nix tools (shell and friends).

3. SQL.

4. Basic IPv4 networking.

These things I learned around 20 years ago, they didn't change much and they are useful for me to this day.

alexhans 5 hours ago [-]
I was a fan of Seven Languages in Seven Weeks [1] because it exposed you to different paradigms which you could then try to apply where they made sense on whatever tools you were using or building: prototype based, fault tolerante, funcional, logical. Very fun book when used right.

The point being that sometimes the tools themselves don't need to survive because you take the lessons from one thing to another (e.g. move semantics and rust/modern c++)

[1] - https://pragprog.com/titles/btlang/seven-languages-in-seven-...

kopirgan 31 minutes ago [-]
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.

sdevonoes 3 hours ago [-]
But you cannot learn it “once”. You need to continuously use it (over those 30 years, for example) to be proficient at it. It’s not that you can study sql for let’s say, 30 days, and never touch/study it again.

I did “learn” sql at uni… but had to study it again at every company i worked for (different problems triggered different solutions). Im still learning it.

theanonymousone 30 minutes ago [-]
I fully agree with the title (with reservation for "dialects"), and I believe the same can be said for JSON and Markdown, among possibly others.
AnonHP 5 hours ago [-]
I’ve always felt that SQL is somewhat easy to grasp for basic queries, but gets complex and difficult for even moderate to higher complexity use cases. My eyes glaze over when I read long stored procedures that someone else has written. Any recommended resources to go from beginner/beginner-intermediate to advanced?
dust-jacket 3 hours ago [-]
My advice is: don't write complicated SQL.

The best thing I learned about SQL is that it can do an awful lot of clever stuff but that the vast majority of the time you really don't need it. Learn the basics. Shrug the rest off.

fauigerzigerk 4 hours ago [-]
The way to learn advanced SQL is to challenge yourself to find a set oriented solution and avoid procedural code. The more unreasonable it feels, the more you learn.

If the solution you find is longer and not much faster than the procedural alternative, you throw it away and fall back on procedural code.

Stored procedures are not advanced SQL. Most of them are not SQL at all. There are a few legitimate reasons for using SPs such as reducing roundtrips to the database and writing little pure functions for use in SQL statements.

But many uses of SPs are just laziness or a symptom of organisational dysfunction.

Cthulhu_ 5 hours ago [-]
I feel like stored procedures and co crosses over into the realm of application programming, and while I can't speak from experience (so take this with a huuuuge grain of salt), this is where things break down. It feels like adding logic / basic programming to JSON/YAML, which are data/config languages primarily.

I think stored procedures - or anything that goes beyond storing / looking up data - had a place when a database had multiple different clients, but with modern day systems that's less likely to be an issue.

oulipo2 5 hours ago [-]
thelastgallon 2 hours ago [-]
Yaml?
veqq 7 hours ago [-]
> Edgar Codd formalised relational algebra in 1970. SQL sits on top of it as a declarative interface. You describe what you want. The database engine decides how to get it. The engine improves every year. Your query stays the same.

Although SQL is of course not relational Algebra (and others like Datalog and D4M are better), it's still cool. It inspired kSQL like Lil uses https://beyondloom.com/decker/lil.html#lilthequerylanguage , which inspired the code I'm most proud of: https://codeberg.org/veqq/declarative-dsls A common query language, a common idiom, for many data structures (arrays, hashmaps, datafremas) is liberating, permitting you to e.g. solve sudoku, make mandelbrot sets or calculate primes directly:

    (def n 40) # to reach primes up to, left is sqr of n, right n/2, then multiply them for rows
    (def composites
    (df/select :from (range 2 (+ 1 (math/floor (math/sqrt n))))
               :cross (range 2 (+ 1 (/ n 2)))
               :where |(<= (* ($ :value_left) ($ :value_right)) n)
               [[:value_left :value_right] :value
                |(* ($ :value_left) ($ :value_right))]))
    (df/select :from (range 2 (+ 1 n)) :exclude composites)
Or e.g.

    (import declarative-dsls/dataframes :as df)
    (def people (df/dataframe :name :age :job))
    (df/dataframe? people)
    
    (df/insert! {:name "Bob" :age 30 :job "Developer"} :into people)
    (df/insert! {:name "Alice" :age 27 :job "Sales"} :into people)
    (df/update! :set {:job "Engineer"}
             :where |(= ($ :job) "Developer")
             :from people)
    
    (df/save-csv people "people.csv" :sep "\\t")
    (def people2 (df/load-csv "people.csv" :sep "\\t"))
    
    (-> people2
       df/dataframe->rows
       df/rows->dataframe
       df/print-as-table)
The tests file has many such things (like the sudoku solver) and even datalog and minikanren implemented on top of this!
andersmurphy 7 hours ago [-]
Datalog is the dream. But SQL with a good query builder like Clojure's honeysql is not so bad.

That and SQLite seems to be able to scale to almost any problem, is disgustingly fast and with litestream incredibly resilient.

Hugsbox 2 hours ago [-]
Well-designed purpose-built tools stand the test of time. When you need a hammer you need a hammer. I learned to swing a hammer a very long time ago, and that skill has stayed with me on modern-day hammers - I didn't have to learn the New Way Of Hammering Things.
gobdovan 4 hours ago [-]
> The Only Programming Language Built on Mathematics, Not Fashion

Had to reread the title again since I thought I opened a different article about TLA+.

As for SQL, if you're referring to DBMS systems, here's what E.F. Codd, inventor of relational algebra, had to say about them and the departure from his work: https://thaumatorium.com/articles/the-papers-of-ef-the-coddf...

tancop 1 hours ago [-]
the main reason i dont like sql is the way it splits your query into parts that run in a different order and you can only have one of each. thats why you need things like ctes. if it was a more "functional" language with features like let bindings it would be easier to understand (and maybe to optimize):

  from customers as c
  let orders := all(orders where customer_id = c.id)
  select c.name, count(orders), avg(orders.price)
glimshe 4 hours ago [-]
Alternatives come and go, SQL stays.

It's not that I like or dislike SQL, it is just that it has such raw power and mature tooling/resources, I wonder what an alternative could even offer me.

It's like C. It does such a great job at being structured assembly that it is hard to displace it for similar reasons.

mihaic 6 hours ago [-]
I've learned SQL around 20 years ago, and in all this time I've felt it was just a poorly designed language. It was always infuriating to write because of its verbose nature. Keywords were split into two words. I'm still shocked it's not "GROUPBY". There is no composition and modularization of logic, queries become massive expressions.

I know I'm in the minority in places like this, but I've spent all my life using ORMs, and never once regretted it. And I'm the kind of person that actually likes low-level C from time to time. SQL just feels like a poor abstraction layer: either go higher or lower.

setr 5 hours ago [-]
It’s a good abstraction layer, and a fundamentally good/effecient model of organization and data management. It’s a horrible language, has a meaningless standards doc, some of the worst debugging tooling of modern system and generally any tooling outside of the RDBMS engine itself is 20 years stale.

The only difficult part in arguing this is that RDBMS != SQL != RelationalAlgebra, and it’s very often forgotten

asksomeoneelse 1 hours ago [-]
Are we really a minority ? Feels like a lot of people just suffer in silence.

Even though I dislike SQL on many levels, I would be hard pressed to find a better, widely supported alternative. I gave up writing portable SQL and just target PostgreSQL now.

alper 5 hours ago [-]
One of the best things that happened to me is my boss giving me a crash course in advanced SQL at my first job. In the database we used at work, he gave me increasingly difficult questions to answer with queries.

It was a great foundation and has served me well to this day.

meszmate 6 hours ago [-]
I’ve been using Postgres for over 6 years (since I started), and I honestly think it’s one of the best investments you can make as a developer
pjmlp 6 hours ago [-]
Additionally learn stored procedures.

Helps simplify complex SQL queries and no need to waste network traffic on data that client side is never going to use, and waste CPU cycles processing it.

Yes, what about database portability?

I am on my 50s and it only mattered on a single project, which was anyway a middleware for application servers.

EvanAnderson 5 hours ago [-]
> Additionally learn stored procedures.

For sure, but have a solid grounding in set theory to go with it.

I've dealt with so many poorly-performing stored procedures that ended up being written as iteration over a CURSOR when they could have been done with sets. Programmers who don't grok set theory reach for iterative constructs which, while they work fine, are an impedance mismatch with SQL.

clappski 5 hours ago [-]
At least in that case you can refactor the stored proc to be more performant without pushing application changes.
pjmlp 5 hours ago [-]
Agreed, however that applies to SQL in general.

I have seen DBAs make wonders without changing queries, only by adding the right set of indexes.

duckmysick 2 hours ago [-]
I moved from stored procedures to dbt. I find it easier to maintain and it helps me with version control, testing, and docs. Plus, since I deal with data pipelines a lot it get other goodies like lineage and auto DDL.
1 hours ago [-]
drayfield 6 hours ago [-]
For me SQL has long been the gateway to the world of development. I work in the UK non-profit sector and traditionally this kind of technical knowledge is rare, so for any team I've worked with I've built learning pathways that start with SQL before pushing out into Python, Linux, and other things. We're not exactly at the bleeding edge of current technologies, but SQL has consistently proved to be a great jumping-off point for novices who have even a passing interest in computing.
shawnhermans 1 hours ago [-]
I resisted learning SQL for years. When I finally got around to learning it, I kicked myself for not learning it sooner. Sure, it has its share of jank and every DB has its own flavor, but at the end of the day you can do insane amounts of data processing using an easy to learn, although sometimes difficult to master, query language.
ivolimmen 6 hours ago [-]
Same can be said for learning an OO programming language or a procedural programming language. I learned C++ at school and started using Java on my first job. I forgot how to work correctly with pointers but I have tried multiple languages (using the same paradigms) and managed to build working software
lanycrost 3 days ago [-]
I've played once with codesignal to pass SQL chapters and it really helped to advance querying skills.
mexicocitinluez 1 hours ago [-]
> Now try this experiment with the JavaScript ecosystem. Take a React component from 2015. React.createClass, mixins, componentWillMount. It doesn't just look old, it throws TypeError: React.createClass is not a function the moment it loads. You rewrite it from scratch to ship it today. Ten years passed, and the framework cycled through three different mental models in that time.

Pretty absurd comparison. SQL is a language, React is not. SQL has been around for over 30 years, React has not.

This is what I refer to as React Derangement Syndrome.

> JavaScript is an imperative language that browser wars, framework trends, and open-source maintainer preferences reshaped every few years. It rewards you for keeping up.

> SQL rewards you for sitting still.

Again, this is apples and oranges. These technologies are in far different places in their history. JavaScript that worked 20 years ago still works today.

You can write an article about how great SQL is without having to bring React up. I promise it's possible.

deepsun 6 hours ago [-]
Just, for god's sake, move SELECT after GROUP BY, I beg you.
grugdev42 5 hours ago [-]
Agreed. SQL has been one of the most stable and useful skills I have.

Rivalled only by Linux, shell scripts, and Cron!

nailer 1 hours ago [-]
I don’t think it’s rational to flatten data. If an item contains an array of sub items which in turn contains an array of subitems, that item belongs in one place not three tables.

I know those view isn’t popular, but I’ve happily used Linux, Python, virtualisation, node and Rust when they were laughed at and I’m not particularly concerned.

Azadeh5 2 hours ago [-]
Learn Cobol once, use it for 100 years :-D
ErroneousBosh 2 hours ago [-]
Having been working with computers professionally for almost 40 years now I've seen quite a lot of things come and go. I'm not convinced that LLMs will stick around for that long although they're currently doing better than "fuzzy logic", which is what it used to be called when they could run on 68HC11s ;-)

You know what has stuck around though?

Thumping great Unix boxes running SQL databases.

Yes, there's a lot wrong with the whole concept, but everything else is in some important way worse.

curtisblaine 7 hours ago [-]
> JavaScript is an imperative language that browser wars, framework trends, and open-source maintainer preferences reshaped every few years. It rewards you for keeping up. > Take a React component from 2015

Javascript is actually fully backwards-compatible, to not break the Web. Any javascript from 10 years ago works in the browser. This is good but also a bit of a burden, since the language can only expand but not shrink. React is a library, and like all libraries it has breaking versions. Not understanding the basic difference between the two kinda undermines the credibility of the article.

Also, in a similar way, core, ANSI SQL is largely backwards compatible, but all the SQL dialects linked to various DBMS implementation are generally incompatible. Obviously that's not mentioned in the article.

> Not a tutorial. Not an ORM. Actual SQL: joins, subqueries, window functions, query plans.

Not text written by a human. Not a style that an real writer would ever use. Actual AI slop: Short sentences. Incorrect facts. Not X, Y.

kibibu 6 hours ago [-]
> Not a tutorial. Not an ORM. Actual SQL: joins, subqueries, window functions, query plans.

My brain absolutely checks out when I read this stuff now.

Not to mention that query plans are absolutely not "actual SQL".

llbbdd 6 hours ago [-]
An article laser-targeted at HN's front page, making tantalizingly negative and easily disprovable claims about Javascript? Perish the thought.
notlibrary 4 hours ago [-]
It's broken expression to update karma brings downvotes

  UPDATE users
  SET karma = 9001
  WHERE name='notlibrary';
einpoklum 5 hours ago [-]
> SQL is the only programming language

SQL is not a programming language. You do not write programs in SQL. It's a declarative language (or set-of-sublanguages).

> a working developer can learn once and > use for 30 years without rewriting their mental model.

There is any number of long-living languages which satisfy this.

Plus, SQL it's not even really a single language, because the spec changes, and is huge, and few people know it fully; and the dialects have non-trivial differences; and if you switch DBMSes, you often switch SQL dialect. In that sense, it is very much like other programming languages which evolve, like C++ or Fortran or even C.

songting591 22 minutes ago [-]
[flagged]
isabellehue 3 hours ago [-]
[flagged]
Ozzie-D 4 hours ago [-]
[flagged]
dluan 2 hours ago [-]
was this article secretly written by regexp
frollogaston 6 hours ago [-]
Everyone knows SQL already. The harder parts that pay off are schema design, knowing how to interact with your DB in code, and knowing all the ins and outs of whatever DBMS you're using.
bob1029 6 hours ago [-]
I would emphasize the importance of batching and set operations. This is where I think many developers lose track of the rabbit, because you don't have much control over either of these things via ORMs. You have to get your hands dirty with raw command text.

The value of this stuff is difficult to overstate. Batching allows for you to rapidly load the RDBMS. The first few times you test, it will probably go so fast you won't believe it loaded anything at all. Set operations allow for you to bring this newly loaded data to visibility in production tables nearly instantly. Your OLAP & OLTP workloads should be dominating the compute. ETL ops (loading/set ops) should be a ghost in terms of cpu time and memory. None of this is vendor specific knowledge. Every major engine has a reasonable way to bulk load and perform quick merging of records.

evdubs 5 hours ago [-]
> I would emphasize the importance of batching and set operations.

Please, preach your gospel more loudly and frequently. It always feels like people complain about RDBMSs being slow because they run insert queries one at a time.

frollogaston 6 hours ago [-]
Well yeah they should've banned ORMs in the Geneva Convention. Quickest way to irreversibly ruin your schema design and backend code.
NetOpWibby 6 hours ago [-]
I refuse to learn SQL. I'm not a computer, I'll let them deal with that.
themafia 6 hours ago [-]
SELECT excuse FROM ignorance ORDER BY snobbery DESC LIMIT 1;
wandering-nomad 4 hours ago [-]
Love it! I am speaking as someone who has used SQL for over two decades with very good success. I find it extremely logical and a good fit for my mental model. Long live SQL!!
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 13:16:57 GMT+0000 (Coordinated Universal Time) with Vercel.