this post was submitted on 19 Oct 2023
12 points (100.0% liked)

Programmer Humor

32060 readers
758 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
top 14 comments
sorted by: hot top controversial new old
[–] [email protected] 0 points 11 months ago (1 children)

Writing SQL on Mac sucks so bad. I hate their caps lock time out

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

macOS has a caps lock timeout? The fuck...

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

capslock drains the battery too quickly

[–] [email protected] 0 points 11 months ago* (last edited 11 months ago) (3 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] 1 points 11 months ago* (last edited 11 months ago)

SQL is turing complete

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

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] 1 points 11 months ago

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] 1 points 11 months ago

Technically, SQL is case-insensitive.

Practically, you want to capitalise the commands anyway.

It gives your code some gravitas. Always remember that when you're writing SQL statements you're speaking Ancient Words of Power.

Does that JavaScript framework that got invented 2 weeks ago by some snot-nosed kid need Words of Power? No. Does the database that has been chugging on for decades upon decades need Words of Power? Yes. Words of Power and all the due respect.

[–] [email protected] 3 points 11 months ago (2 children)

Speaking as a Senior Dev specialized in database access and design... you don't have to use all caps - SQL is actually case agnostic.

But... but my fucking eyes man. I'm old, if your branch doesn't have control keywords in all caps I'm going to take it out back and ol' yeller it.

There are few hills I'll die on but all caps SQL and singular table names are two of them.

[–] [email protected] 1 points 11 months ago (1 children)

Singular table names? You savage…

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

It's an English literacy thing - we have several non-native English speakers and using only singular avoids making those folks' lives harder. Besides it's really nice to autopilot that categoryid is a foreign key to the category table. It also simplifies always plural words... I haven't yet written CREATE TABLE pants but if I ever do there's zero chance of me creating a pantid.

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

no underscores either? What are we, apes?

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

I'm a sql developer, and I am completely the opposite to you. I will find it incredibly difficult to read when everything is in caps

[–] [email protected] 0 points 11 months ago

You should do a project together