1409
Little Timmy Tables (programming.dev)
you are viewing a single comment's thread
view the rest of the comments
[-] joyjoy@lemmy.zip 106 points 1 month ago* (last edited 1 month ago)

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 69 points 1 month ago

The income is a nice touch.

[-] criss_cross@lemmy.world 30 points 1 month ago

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

[-] laurelraven@lemmy.zip 11 points 1 month ago

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

[-] naeap@sopuli.xyz 4 points 1 month ago* (last edited 1 month ago)
[-] RustyShackleford@programming.dev 5 points 1 month ago

The poor nice ones get beaten by the naughty rich ones.

[-] ulterno@programming.dev -1 points 1 month ago

... and by the "nice" rich ones.

[-] KairuByte@lemmy.dbzer0.com 8 points 1 month ago

Why are we using magic strings for behavior?

[-] joyjoy@lemmy.zip 28 points 1 month ago

Feel free to fork my comment. 

[-] Tja@programming.dev 12 points 1 month ago

Does Santa accept PRs?

[-] uranibaba@lemmy.world 2 points 1 month ago
CREATE VIEW NiceList AS
 SELECT * FROM Children
  WHERE behavior > 2000
   AND parent.income > 40000; 
CREATE VIEW NaughtyList AS
 SELECT * FROM Children
  WHERE behavior <= 2000; 
[-] TheOctonaut@mander.xyz 16 points 1 month ago

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

[-] Olap@lemmy.world 6 points 1 month ago

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 6 points 1 month ago

I like your DBA!

Users probably don't.

[-] djmikeale@feddit.dk 10 points 1 month 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"

[-] ryannathans@aussie.zone 7 points 1 month ago
[-] joyjoy@lemmy.zip 5 points 1 month ago

Omitted for brevity. 

[-] Willy@sh.itjust.works 5 points 1 month ago

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

[-] menas@lemmy.wtf 3 points 1 month ago

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

[-] joyjoy@lemmy.zip 8 points 1 month ago

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

this post was submitted on 16 Dec 2025
1409 points (99.3% liked)

Programmer Humor

29320 readers
1682 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