this post was submitted on 16 Dec 2025
1249 points (99.4% liked)

Programmer Humor

27898 readers
2046 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] NullPointerException@lemmy.ca 94 points 1 day ago (5 children)

Why would Santa need two separate tables for this?

[–] spiffpitt@lemmy.world 131 points 1 day ago

don't underestimate database design in production environments

[–] joyjoy@lemmy.zip 89 points 1 day ago* (last edited 1 day ago) (6 children)

I would make two separate views. 

CREATE VIEW NiceList AS
 SELECT * FROM Children
  WHERE behavior = 'nice' 
   AND parent.income > 40000; 
CREATE VIEW NaughtyList AS
 SELECT * FROM Children
  WHERE behavior = 'naughty'; 
[–] NullPointerException@lemmy.ca 56 points 1 day ago

The income is a nice touch.

[–] menas@lemmy.wtf 3 points 20 hours ago (1 children)

which default currency shall santa use ? Dollar have no sense, if presents are free. However Yuan may ease things with providers.

[–] joyjoy@lemmy.zip 7 points 17 hours ago

He's in the north pole, so probably Canadian dollars, Russian rubles, or Danish krone (Greenland) 

[–] criss_cross@lemmy.world 22 points 1 day ago (1 children)

The poor kids can’t even afford coal and fall through the cracks.

[–] laurelraven@lemmy.zip 9 points 17 hours ago (1 children)

Only the nice ones, the naughty poor children get free coal

[–] naeap@sopuli.xyz 1 points 13 hours ago* (last edited 13 hours ago)

But not the poor nice ones

[–] KairuByte@lemmy.dbzer0.com 7 points 1 day ago (3 children)

Why are we using magic strings for behavior?

[–] joyjoy@lemmy.zip 27 points 1 day ago (1 children)

Feel free to fork my comment. 

[–] Tja@programming.dev 10 points 1 day ago

Does Santa accept PRs?

[–] djmikeale@feddit.dk 9 points 1 day ago

He used to have an is_nice bool but consultants convinced Santa it isn't future proof enough to capture the nuances of kids behaviour in today's world, such as "nice but always is really smug about it". But the consultants kept making PowerPoints instead of updating the backend, so now Santa also has added a new value to behaviour: "consultant-like"

[–] TheOctonaut@mander.xyz 13 points 1 day ago (1 children)

It's an ENUM and other people have to read this fucking codebase too, Brian!

[–] Olap@lemmy.world 4 points 1 day ago (1 children)

I've a DBA who would insist on this being in a dimension table and using a foreign key constraint instead of just a fucking string

[–] luciferofastora@feddit.org 4 points 23 hours ago

I like your DBA!

Users probably don't.

[–] ryannathans@aussie.zone 6 points 1 day ago (1 children)
[–] joyjoy@lemmy.zip 4 points 1 day ago

Omitted for brevity. 

[–] Willy@sh.itjust.works 4 points 1 day ago

stop static “variables”! use COL. congress should do the same for setting minimum wage. eg parent.income > COL

[–] luciferofastora@feddit.org 13 points 23 hours ago

Legacy system. Someone once started curating two spreadsheets for each year because they didn't know better. They had different formats too, because the naughty one listed separate entries for each naughty deed and a column describing it. Whenever they added something to that list, they manually checked and deleted the kid from the nice list.

Eventually, the amount of children they're responsible for got too large, so they learned some basic SQL and built themselves a database. To import the legacy lists and keep their workflow, they built separate tables. Just be glad they eventually learned how to filter by year and stopped creating new schemas for every year.

[–] ilinamorato@lemmy.world 10 points 1 day ago* (last edited 16 hours ago)

Relational database. He's got children, which joins to naughty and nice on childid and both record their status each year so that he can monitor trends.

[–] chocrates@piefed.world 5 points 1 day ago

Once you get a few thousand columns wide you create a naughty_list2 for the new data