this post was submitted on 14 Mar 2024
599 points (96.6% liked)

Programmer Humor

19488 readers
1203 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 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] 7heo@lemmy.ml 26 points 7 months ago

That isn't real. It wouldn't pass peer review. Here is the actual code:

function GetCookieValue(x) {
  return JSON.stringify(x);
}

user.cookies.agreed = Boolean(GetCookieValue(true));

if(!DarkPatternPopup()) {
  // Make sure we respect the user choice
  user.cookies.agreed = Boolean(GetCookieValue(false));
}

if(user.cookies.agreed) CollectData(user);