• wise_pancake@lemmy.ca
    link
    fedilink
    arrow-up
    70
    ·
    8 months ago

    we’ve updated our terms of service, you’re now opted in to everything, good luck!

    And

    Yes, you unsubscribed from that mailing list, but before you did we went and put your name down for 575 new email lists which you have not unsubscribed from.

    • AwkwardLookMonkeyPuppet@lemmy.world
      link
      fedilink
      English
      arrow-up
      12
      ·
      edit-2
      8 months ago

      That first one should be punishable by flogging. Also the second one, but the first one is a very common strategy for opting you in to things you explicitly opted out of, and I’m pretty sure it’s illegal. But, since no one ever enforces the law against mega corps, they’re free to operate with impunity.

  • 7heo@lemmy.ml
    link
    fedilink
    arrow-up
    27
    ·
    8 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);
    
  • ramius345@sh.itjust.works
    link
    fedilink
    arrow-up
    20
    ·
    8 months ago

    Don’t need an if, just set the variable and collect the data. Saved you a jump instruction. The compiler is going to optimize it out anyway, but simpler code is better and some people forget the -O flag.

    • Sibbo@sopuli.xyz
      link
      fedilink
      arrow-up
      3
      ·
      8 months ago

      Yeah but the last requires you to explicitly distinguish between the two cases.

  • MxM111@kbin.social
    link
    fedilink
    arrow-up
    3
    ·
    8 months ago

    The only problem with the code I see is that the first 3 lines are not needed.

    /Google