Live data from Hacker News

Learn SQL Once, Use It for 30 Years

fagnerbrack.com

71–80 of 243 posts

Re: Learn SQL Once, Use It for 30 Years

#71
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.

Re: Learn SQL Once, Use It for 30 Years

#72

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 spectacu…

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.

Re: Learn SQL Once, Use It for 30 Years

#73

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...

Re: Learn SQL Once, Use It for 30 Years

#74
> 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.

Re: Learn SQL Once, Use It for 30 Years

#75
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)

Re: Learn SQL Once, Use It for 30 Years

#76

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 spectacu…

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...

Re: Learn SQL Once, Use It for 30 Years

#77
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.

Re: Learn SQL Once, Use It for 30 Years

#78
post #17

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 O…

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.

Re: Learn SQL Once, Use It for 30 Years

#79

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 spectacu…

> 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.

Re: Learn SQL Once, Use It for 30 Years

#80
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.

Post reply on HN