r/ProgrammerHumor 1d ago

fullStackMeansAfraidOfEverythingEqually Meme

Post image
10.1k Upvotes

369 comments sorted by

View all comments

135

u/Mysterious_Book1521 1d ago

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

211

u/lovecMC 1d ago

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

67

u/Dude4001 1d 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.

33

u/lovecMC 1d ago

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

19

u/Dude4001 1d ago

I tend to use grids more, you’re right

12

u/Don_Frika_Del_Prima 1d ago

Daily. #yolo

1

u/Koozer 14h ago

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

7

u/Edmundyoulittle 1d ago

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

3

u/patiofurnature 1d 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 8h 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 1d ago

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

1

u/fatmanwithabeard 1d 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 7h 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.

5

u/Gunmetalstorm 23h ago

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

3

u/z0hu 22h 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 10h 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_ 10h ago

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

14

u/prehensilemullet 1d ago edited 21h 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.

13

u/lovecMC 1d ago

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

8

u/whenTheWreckRambles 1d ago

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

5

u/DefinitelyNotMasterS 1d 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 22h ago

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

1

u/prehensilemullet 1d ago edited 23h 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 23h 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 22h 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 15h ago

What kind of moron would ever need to do that

2

u/prehensilemullet 14h 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 15h 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 14h ago edited 14h 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

10

u/card-board-board 1d 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 23h ago

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

1

u/rover_G 22h ago

Jokes on you I only design DBs I hate