Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Sjmarf@sh.itjust.works to Programming Humor@lemmy.worldEnglish · 8 months ago

CompareBooleans

sh.itjust.works

message-square
79
fedilink
74

CompareBooleans

sh.itjust.works

Sjmarf@sh.itjust.works to Programming Humor@lemmy.worldEnglish · 8 months ago
message-square
79
fedilink
alert-triangle
You must log in or register to comment.
  • AbsoluteChicagoDog@lemm.ee
    link
    fedilink
    English
    arrow-up
    17
    arrow-down
    1
    ·
    8 months ago

    deleted by creator

    • Lovable Sidekick@lemmy.world
      link
      fedilink
      English
      arrow-up
      8
      ·
      8 months ago

      My boss’s boss, a former Ops manager who liked to keep track of system stats, once asked her why the CPU usage on the dev box had decreased that month. Weren’t the devs doing any work?

  • bleistift2@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    10
    ·
    8 months ago

    Don’t forget the invocation

    if (CompareBooleans(a, b) == true)
    
    • magic_lobster_party@fedia.io
      link
      fedilink
      arrow-up
      9
      ·
      8 months ago

      if (CompareBooleans(CompareBooleans(a, b), true))

      • TriflingToad@lemmy.world
        link
        fedilink
        English
        arrow-up
        8
        ·
        8 months ago

        I don’t like this thread anymore :(

        • Log in | Sign up@lemmy.world
          link
          fedilink
          English
          arrow-up
          2
          ·
          8 months ago

          No, no, this is actually the only correct code in the thread.

      • min@lemmy.sdf.org
        link
        fedilink
        English
        arrow-up
        1
        ·
        8 months ago

        that… actually works…

  • becausechemistry@lemm.ee
    link
    fedilink
    English
    arrow-up
    10
    ·
    8 months ago

    Management: Gee whiz, we really have no idea how to gauge productivity to decide who gets promoted. We could manage. Or, better, we could just have someone write a script that pulls info from git on how many lines of code each person has written.

    Programmers:

    • curiousaur@reddthat.com
      link
      fedilink
      English
      arrow-up
      4
      ·
      8 months ago

      I promote based on lines of code removed.

      • DontRedditMyLemmy@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        8 months ago

        I quit based on idiotic metrics

        • curiousaur@reddthat.com
          link
          fedilink
          English
          arrow-up
          2
          ·
          8 months ago

          Ah, the idiotic idiotic metric metric.

          • DontRedditMyLemmy@lemmy.world
            link
            fedilink
            English
            arrow-up
            0
            arrow-down
            2
            ·
            8 months ago

            Are you 14?

            • ✺roguetrick✺@lemmy.world
              link
              fedilink
              English
              arrow-up
              2
              ·
              8 months ago

              I don’t know what the age metric has to do with anything.

            • Log in | Sign up@lemmy.world
              link
              fedilink
              English
              arrow-up
              2
              ·
              8 months ago

              I’m sure it was meant as a joke, not a serious criticism.

              I think we can all agree that managers who have no idea what’s important absolutely suck

      • OpenStars@discuss.online
        link
        fedilink
        English
        arrow-up
        2
        ·
        8 months ago

        Which is all the easier to do when you start off with a higher number…

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

          Add heavily verbose/redundant math equations that take up multiple lines with each operation saving to a new variable, then either decrease the number of variable declarations or condense/simplify the math occasionally. Repeat with each new function. Killing two metrics at once LOC and the removal of LOC for older functions. Guaranteed promotions. lol

  • just_an_average_joe@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    9
    ·
    8 months ago

    Wait areBooleanEqual returns false when they are equal?

    • breadsmasher@lemmy.world
      link
      fedilink
      English
      arrow-up
      13
      ·
      8 months ago

      yesn’t

      • Log in | Sign up@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        8 months ago

        This actually made me laugh, thank you.

    • not_woody_shaw@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      8 months ago

      That’s not even the worst part. What the fuck does a function named Compare_anything do? Does it return anything? It sounds like nothing but a side effect.

      • idunnololz@lemmy.world
        link
        fedilink
        English
        arrow-up
        7
        ·
        8 months ago

        Usually comparison functions are supposed to return an integer and are usually useful for sorting. However this one returns a bool so it’s both useless and terribly named.

      • BatmanAoD@lemmy.world
        link
        fedilink
        English
        arrow-up
        5
        ·
        8 months ago

        The unnecessary and confusing functions are horrible, yes, but I’d still say that the fact that they’re wrong is the “worst” part.

        • WoahWoah@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          8 months ago

          That’s enough chit-chat, nerds. Back to work.

          • Management
  • Moah@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    8
    ·
    8 months ago

    I’m a bit disappointed there isn’t a call to GetBooleanValue in there

  • Lovable Sidekick@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    8 months ago

  • zarkanian@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    4
    ·
    8 months ago

    If this were a Node module, I wouldn’t even be surprised.

  • kaffiene@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    8 months ago

    WTAF? Is this written by a hallucinating AI?

    • pflanzenregal@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      8 months ago

      I think it’s a joke (maybe)

    • Leate_Wonceslace@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      2
      ·
      8 months ago

      I don’t think this is the sort of error an AI would make.

    • olympicyes@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      8 months ago

      I’ve asked ChatGPT to create boiler plate code and it will offer these nested functions so you can change the logic in the future. It’s not smart enough to ask why you’re doing something a particular way or suggest a better alternative.

  • aiden@lemm.ee
    link
    fedilink
    English
    arrow-up
    3
    ·
    8 months ago

    This is code after working 16 hours

    • Maalus@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      8 months ago

      I’d give my right hand this is a code review problem. Someone extracted a method returning true false. Then an intern came along and was told to refactor. They saw a lot of comparisons and “extracted” them.

      • im sorry i broke the code@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        8 months ago

        My coworker made an array of book to express a status. This is no doing of an intern but a much eviler force at play.

  • Grandwolf319@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    3
    ·
    8 months ago

    Two wrongs don’t make a right, but sometimes in programming, two bugs can cancel each other out.

    Whoever wrote this is more than capable of using it incorrectly.

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

    There’s no way, that’s so insane it has layers.

    • Ledivin@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      8 months ago

      At first, I thought the shitty methods were the joke 😱😱😱

  • ToxicWaste@lemm.ee
    link
    fedilink
    English
    arrow-up
    2
    ·
    8 months ago

    can’t believe they forgot to implement bool IsTrue(bool) and bool IsFalse(bool) 🙄

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

    Clearly it should be return orig == val

    Duh

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

      To match the current behavior it should be orig != val

      • marx2k@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        8 months ago

        You’re hired. Can your start on Monday?

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

    I misread it as CompareBolians. No more Star Trek memes for me today.

    • WhiskyTangoFoxtrot@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      8 months ago

      Many Bolians died bringing us this information.

  • Treczoks@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    8 months ago

    Straight from the famous book “Making LOCs for Dummies”

Programming Humor@lemmy.world

programminghumor@lemmy.world

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Related Communities [email protected] [email protected] [email protected] [email protected]

Other Programming Communities [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 20 users / week
  • 391 users / month
  • 1.48K users / 6 months
  • 1 local subscriber
  • 3.19K subscribers
  • 87 Posts
  • 432 Comments
  • Modlog
  • mods:
  • 2e8a9d6bb6935a54@lemmy.world
  • BE: 0.19.9
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org