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

CompareBooleans

sh.itjust.works

message-square
80
fedilink
74

CompareBooleans

sh.itjust.works

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

    deleted by creator

    • Lovable Sidekick@lemmy.world
      cake
      link
      fedilink
      English
      arrow-up
      8
      ·
      1 year 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?

  • becausechemistry@lemm.ee
    link
    fedilink
    English
    arrow-up
    10
    ·
    1 year 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
      ·
      1 year ago

      I promote based on lines of code removed.

      • DontRedditMyLemmy@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        1 year ago

        I quit based on idiotic metrics

        • curiousaur@reddthat.com
          link
          fedilink
          English
          arrow-up
          2
          ·
          1 year ago

          Ah, the idiotic idiotic metric metric.

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

            Are you 14?

            • ✺roguetrick✺@lemmy.world
              link
              fedilink
              English
              arrow-up
              2
              ·
              1 year 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
              ·
              1 year 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
        ·
        1 year 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
          1 year 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

  • bleistift2@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    10
    ·
    1 year ago

    Don’t forget the invocation

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

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

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

        I don’t like this thread anymore :(

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

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

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

        that… actually works…

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

    Wait areBooleanEqual returns false when they are equal?

    • breadsmasher@lemmy.world
      link
      fedilink
      English
      arrow-up
      13
      ·
      1 year ago

      yesn’t

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

        This actually made me laugh, thank you.

    • not_woody_shaw@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 year 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
        ·
        1 year 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
        ·
        1 year 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
          ·
          1 year ago

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

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

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

  • Lovable Sidekick@lemmy.world
    cake
    link
    fedilink
    English
    arrow-up
    6
    ·
    1 year ago

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

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

  • kaffiene@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    WTAF? Is this written by a hallucinating AI?

    • pflanzenregal@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      I think it’s a joke (maybe)

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

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

    • olympicyes@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year 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
    ·
    1 year ago

    This is code after working 16 hours

    • Maalus@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year 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
        ·
        1 year 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
    ·
    1 year 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.

  • marx2k@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Clearly it should be return orig == val

    Duh

    • offspec@lemmy.world
      link
      fedilink
      English
      arrow-up
      12
      ·
      1 year ago

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

      • marx2k@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        1 year ago

        You’re hired. Can your start on Monday?

  • ToxicWaste@lemm.ee
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

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

  • angrystego@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

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

    • WhiskyTangoFoxtrot@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      Many Bolians died bringing us this information.

  • carl_dungeon@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

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

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

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

  • macniel@feddit.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    But how do you test for FILE_NOT_FOUND?

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
  • 1 user / week
  • 91 users / month
  • 1.26K users / 6 months
  • 1 local subscriber
  • 3.28K subscribers
  • 91 Posts
  • 442 Comments
  • Modlog
  • mods:
  • 2e8a9d6bb6935a54@lemmy.world
  • BE: 0.19.9
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org