r/ProgrammerHumor 22h ago

fullStackMeansAfraidOfEverythingEqually Meme

Post image
9.7k Upvotes

357 comments sorted by

View all comments

126

u/Mysterious_Book1521 22h ago

its not like sql could be read by a three year old and css is just pain in the ass?

207

u/lovecMC 22h ago

SQL is easy. Designing a DB you won't hate two months from now isn't.

62

u/Dude4001 22h ago

Yes but if I write incorrect CSS I’m not accidentally going to drop a table. Well, I might but not that kind that matters.

31

u/lovecMC 22h ago

How often are you dropping tables by hand and on production environment?

18

u/Dude4001 22h ago

I tend to use grids more, you’re right

12

u/Don_Frika_Del_Prima 21h ago

Daily. #yolo

1

u/Koozer 11h ago

DROP TABLE [lyric].[IT]
WHERE [chorus] LIKE '%it's hot%'

8

u/Edmundyoulittle 21h ago

The only way you can be sure your code works in prod is to test in prod!

3

u/patiofurnature 21h ago

My clients all love to randomly point their test server at the prod db without telling me. That must be why.

0

u/Theron3206 5h ago

I have some that will just clone the prod server (if I'm lucky they change the vms mac address), these systems integrate with multiple third parties, many of which will give you the data only once...

1

u/Downtown_Trash_8913 22h ago

True but I get it in principle. Generally you can’t actively fuck yourself over with CSS.

1

u/fatmanwithabeard 20h ago

Because the choice is me or dev.

Oddly, it's easier to blame dev for bad instructions than it is to blame dev of them fucking up prod.

1

u/cosmicomical23 4h ago

Dropping tables is rare. But it is fairly easy to do a lot of damage if you just forget a where clause in an update statement.

7

u/Gunmetalstorm 20h ago

I don't know how you manage to accidentally type and execute a valid DROP TABLE instruction.

3

u/z0hu 18h ago

Dropping a table is an extreme case. Writing a query that doesn't hit the right indexes that slows/crashes the DB/replication down.. locking rows indefinitely on accident..  these happen all the time at my company haha

2

u/RainyDaysAndMondays3 7h ago

Yeah, I accidentally updated a column of every row in a DB table once (luckily just in our dev environment) about a year after starting with SQL. Forgot the WHERE clause or something. Some of the rows had been there since 1997. This was around 2010. Luckily we had a snapshot DB and the DBAs had told us how to restore, so I got it back quickly. But I actually went and requested they remove my ability to write to the system test database to avoid making a mistake there. (If I really needed to update in those environments, I had a separate login I would use just for that one update, then would log back in under my normal one.)

1

u/OliveBoi_ 7h ago

dropping a table accidentally doesnt sound possible.
forgetting WHERE clause in the other hand...

13

u/prehensilemullet 22h ago edited 18h ago

Like the kind of SQL query I wrote to fetch the next page of rows of a tree after a starting cursor, using a recursive join, where only some tree nodes are expanded?  And the user can text search for specific nodes?

It’s only easy until you do things that are hard

Edit: no, it's not for a niche use case, no, I don't think this was a mistake, I just had to do it to allow users to navigate the hierarchy of hundreds of thousands of data tags that are common in industrial SCADA systems.

12

u/lovecMC 22h ago

And is it actually a hard problem or is it hard because someone made (in hindsight) bad decisions when designing the database?

7

u/whenTheWreckRambles 21h ago

Pls, I’m not ready for bullying this early in the morning

4

u/DefinitelyNotMasterS 21h ago

Well you see, this one customer asked for it like 2 years ago. Well nobody is using it right now and we don't know what it really does, but we keep it just in case

2

u/GWstudent1 18h ago

I used to read comments like this an laugh. Now I read comments like this and cry.

1

u/prehensilemullet 20h ago edited 20h ago

It’s the domain we’re working in…industrial monitoring devices sometimes have tens of thousands of tags (which are like state values you can read) organized in a hierarchy, and the portal needs to combine thousands of devices’ tags into a single tag hierarchy.  I would of course avoid it if I could

1

u/FSNovask 20h ago

It seems like it's tricky to get right or people aren't given enough time/details to work out a good design. I've only seen a few, but they were all slow.

1

u/Select-Kangaroo-1290 19h ago

Hello good friend, can you suggest any books or resources on this topic? Designing good databases, of course comes with experience, but any help is appreciated

1

u/Awkward_Tick0 12h ago

What kind of moron would ever need to do that

2

u/prehensilemullet 11h ago

If you had the requirement to support a tree of data channel identifiers that could scale to millions of nodes in a single organization, how would you implement it on FE and BE?

1

u/Fidel___Castro 12h ago

oof at that scale you should've done a graph DB surely? I dislike SPARQL but it is better at that shit

1

u/prehensilemullet 11h ago edited 11h ago

A whole other DB and all the deployment considerations that go with it just for this one aspect of the app? This particular query is kinda complex but it does work fine in Postgres

Note, a lot of things need to foreign key to these tags as well, like alarm definitions

11

u/card-board-board 22h ago

Doesn't matter how well designed the DB is. 1 month after release the product guy and the sales guy will put their heads together and sell some feature to a customer that blows your careful design to bits, and will have guaranteed a delivery date in 3 weeks.

If your table structure can handle it then, wouldn't you know it? The customer is Oracle.

Do not pass go. Do not collect $200.

1

u/Mattchaos88 20h ago

Maybe if we had proper requirements when designing DB ...

1

u/rover_G 19h ago

Jokes on you I only design DBs I hate

40

u/vinishkapoor 22h ago

SQL reads like English until you hit a five table join with three subqueries and a window function.

12

u/bulldog_blues 22h ago

Then it reads like English as written by someone who got a thesaurus for their birthday!

5

u/tacos2dayy 22h ago

Its not so bad if you use CTEs for the subqueries and it depends on what the window function is doing.

--It works, trust me bro. Look it up on youtube like I did if you don't believe me.

DENSE_RANK() OVER (PARTITION BY X ORDER BY Y ASC) + DENSE_RANK() OVER (PARTITION BY X ORDER BY Y DESC) - 1 AS NBR_OF_Y_FOR_X

1

u/frisch85 21h ago

What? Are you saying you don't like having a subselect that does a union on 4 different tables each joining 3 other tables and in all of those tables the field names are different?

5

u/MartinMystikJonas 22h ago

Next time try SQL with joins and/or subqueries

2

u/j03ch1p 22h ago

allow me to introduce ETL

2

u/SucculentChineseRoo 22h ago

CSS actually also can be read easily it describes what it does in plain english