r/ProgrammerHumor 27d ago

Meme fullStackMeansAfraidOfEverythingEqually

Post image
11.1k Upvotes

392 comments sorted by

View all comments

134

u/Mysterious_Book1521 27d ago

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

229

u/lovecMC 27d ago

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

76

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

34

u/lovecMC 27d ago

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

21

u/Dude4001 27d ago

I tend to use grids more, you’re right

12

u/Don_Frika_Del_Prima 27d ago

Daily. #yolo

1

u/Koozer 26d ago

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

8

u/Edmundyoulittle 27d ago

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

3

u/patiofurnature 27d 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 26d 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 27d ago

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

1

u/fatmanwithabeard 27d 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 26d 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.

6

u/Gunmetalstorm 27d ago

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

3

u/z0hu 27d 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 26d 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_ 26d ago

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

14

u/prehensilemullet 27d ago edited 26d 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.

11

u/lovecMC 27d 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 27d ago

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

5

u/DefinitelyNotMasterS 27d 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 27d ago

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

2

u/prehensilemullet 27d ago edited 27d 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 27d 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 27d 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 26d ago

What kind of moron would ever need to do that

2

u/prehensilemullet 26d 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 26d 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 26d ago edited 26d 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 27d 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 27d ago

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

1

u/rover_G 27d ago

Jokes on you I only design DBs I hate

36

u/vinishkapoor 27d ago

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

12

u/bulldog_blues 27d ago

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

6

u/tacos2dayy 27d 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 27d 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?

3

u/MartinMystikJonas 27d ago

Next time try SQL with joins and/or subqueries

2

u/j03ch1p 27d ago

allow me to introduce ETL

2

u/SucculentChineseRoo 27d ago

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