this post was submitted on 19 Oct 2023
1723 points (98.8% liked)

Programmer Humor

32380 readers
1277 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 49 points 1 year ago* (last edited 1 year ago) (12 children)

The phrase "SQL programmers" is so fucking weird. SQL isn't a programming language. It's a query language. You don't "program" things with SQL. You utilize SQL as a component of programs for data insertion and lookup, but the actual logic of execution is done in a programming language. Unless you're doing Oracle PL/SQL, in which case why are you giving money to Oracle?

Edit: Damn, this comment made people mad.

[–] [email protected] 41 points 1 year ago (1 children)

Your knowledge of data engineering may be limited. SQL is predominant in data processing nowadays. FOSS tools such as DBT allows to write efficient data processing pipelines with SQL and some YAML config without the need for a general purpose coding language.
Why would anyone want that? Because SQL has the interesting property of describing the result you want rather than describing how to compute it. So you can put inside the database, a query engine with decades of optimizations, that will make a much better job at finding the best execution plan than the average developer.
It also means it's easier to train people for data processing nowadays.

[–] [email protected] 3 points 1 year ago

Learning DBT was pretty easy for me as a data analyst. Now I’m contributing to my company’s data warehouse instead of just pulling existing data.

[–] [email protected] 37 points 1 year ago (1 children)

Most database engines support stored procedures. You don't need to give money to oracle, you can give it to Microsoft instead.

[–] [email protected] 18 points 1 year ago* (last edited 1 year ago) (1 children)

Or not at all? Postgres? MariaDB? I think I missed the /s. I'm slow hah

[–] [email protected] 4 points 1 year ago

Yes, those work :-) giving money to MS was more of a joke.

[–] [email protected] 34 points 1 year ago* (last edited 1 year ago) (1 children)

T-SQL is turing complete. While the MS SQL server has limitations on OS level operations, if you allow yourself some leeway with CLR wrappers for the win32 API, there's no reason I can think of you wouldn't be able to get the database engine to be a webserver reacting to incoming requests on port 80, or drawing GUIs based off of table state.

It's be slow and terrible, but doable.

[–] [email protected] 6 points 1 year ago

It's doable. Personal experience

[–] [email protected] 30 points 1 year ago (1 children)

I'm a markdown programmer and i disagree with this statement

[–] [email protected] 2 points 1 year ago

LaTeX being called "programming" I can see, but I've never heard someone try to justify Markdown as programming. It's just formalizing things people were already doing to format text in plain text files into approximately half of a standard.

[–] [email protected] 30 points 1 year ago (3 children)

This doesn't make sense to me. SPs and functions are in every major database. If I wrote a bash script that runs like a program, and sounds like a program, did I program it? Script it?

And lots of systems have nested logic in the DB, optimization often leads to that to reduce overhead. Unless you're being lazy with an ORM like prisma that can't even join properly.

Getting high performing queries is just as difficult as any other programming language, and should be treated as such. Even Lemmy's huge performance increases to .18ish came from big PG optimizations.

[–] [email protected] 11 points 1 year ago

It seems to be about yelling at others that "you're not a real programmer!!!" mixed with being so "technically correct" my eyes can no longer roll the same way they used to.

[–] [email protected] 4 points 1 year ago

It's mostly ignorance. People tend to underestimate or dismiss things they don't completely understand.

[–] [email protected] 0 points 1 year ago (1 children)

Admittedly, this discussion is more one of semantics than anything. It's pretty clear I'm arguing that SQL is not a "General Purpose Language," and that proficiency in that domain is what constitutes programming. Which, yeah, is arguably somewhat arbitrary. But my point is that, colloquially, someone who only works with SQL isn't a programmer. Data Engineer, sure. DBA. Also, sure. Depends on what you do. Programmer? Not really. Not unless you (as in the person, not "it's theoretically possible") can use raw SQL to read in video data from a linux system device file and then encode it to mp4 and just nobody's told me.

[–] [email protected] 3 points 1 year ago

Do that in Javascript. Or HTML. Or CSS. Or by that logic is a web developer not a programmer? What about microcontroller programmers?

I could easily write a full logic program in SQL where the API just feeds it data, which is the inverse of how you treat SQL. Admittedly that's not as common, but it happens pretty frequently in areas of big data, like medical.

I've hired Senior Software Engineers that were DBAs, and others that weren't. They were a development team, all programmers in their own right.

[–] [email protected] 23 points 1 year ago* (last edited 1 year ago) (1 children)

You don't "program" things with SQL

Why not? It sounds like you haven't written any OLAP queries :)

I've written ETL data pipelines using a system similar to Apache Airflow, where most of the logic is in SQL (either Presto or Apache Spark) with small pieces of Python to glue things together. Queries that are thousands of lines long that take ~30 minutes to run and do all sorts of transformations to the data. They run once per day, overnight. I'd definitely call that programming.

Most database systems support stored procedures, which are just like functions - you give them some input and they give you some output and/or perform some side effects.

[–] [email protected] 2 points 1 year ago (1 children)

thousands of lines long that take ~30 minutes

Oh yea!!! Well I have 76 lines of code that takes up to 18 hours to run for 1 client!!!!!

/s

[–] [email protected] 2 points 1 year ago

Haha I only mentioned the run time to provide some context, since a lot of people have only ran OLTP queries that take less than a few seconds to run.

[–] [email protected] 23 points 1 year ago* (last edited 1 year ago) (3 children)
[–] [email protected] 10 points 1 year ago (1 children)
[–] [email protected] 2 points 1 year ago* (last edited 1 year ago)

So is Magic: The Gathering

[–] [email protected] 2 points 1 year ago

I'm a magic the gathering programmer

[–] [email protected] 1 points 1 year ago (3 children)

So is Tex. And, yet, I still don't put it under the "programming languages I know" section on my resume. Probably because it's not a programming language.

[–] [email protected] 2 points 1 year ago (1 children)

Try it. Maybe you won't need a resume anymore.

[–] [email protected] 0 points 1 year ago

It's important to keep an up to date resume, even if you're employed. That's a little life pro tip for you kids out there, with your iphones and your tik toks and your Fortnite dances and your existential malaise brought about by encroaching climate disaster and advanced technoindustrial capitalism.

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

Where you put it is not my problem.

The general census is that latex actually is an example of programming languages sharing semantics with non programming languages and not being intend as a programming language.

since you linked to wikipedia:

The domain of the language is also worth consideration. Markup languages like XML, HTML, or troff, which define structured data, are not usually considered programming languages.[12][13][14] Programming languages may, however, share the syntax with markup languages if a computational semantics is defined. XSLT, for example, is a Turing complete language entirely using XML syntax.[15][16][17] Moreover, LaTeX, which is mostly used for structuring documents, also contains a Turing complete subset.[18][19]

Programming language

Sometimes even non Turing complete languages are considered a programming language but Turing completeness usually is the criteria agreed upon:

The majority of practical programming languages are Turing complete,[5] and all Turing complete languages can implement the same set of algorithms. ANSI/ISO SQL-92 and Charity are examples of languages that are not Turing complete, yet are often called programming languages.[6][7] However, some authors restrict the term "programming language" to Turing complete languages.[1][8]

[–] [email protected] 1 points 1 year ago

What section would you put it under? It isn't clear to me where it would fit

[–] [email protected] 9 points 1 year ago (1 children)
[–] [email protected] 5 points 1 year ago

MS SQL Server has this thing called Replication. It's a feature to keep tables in sync between databases, and even database servers. There's merge replication (two way), snapshot replication (one way scheduled publishing), and transaction replication (one way live-ish publishing).

And the logic is all implemented in T-SQL stored procedures.

I fucking hate it.

[–] [email protected] 4 points 1 year ago

Me losing my mind in 3000 lines of Oracle PL/SQL processing scripts in a Bank some time ago agrees with your last statement.

[–] [email protected] 2 points 1 year ago

This comment has a concerning amount of replies. Its just semantic BS.

[–] [email protected] 0 points 1 year ago

Bahahahhahahahhahahahhahahaa. No.