• rothaine@lemm.ee
      link
      fedilink
      arrow-up
      19
      ·
      10 months ago

      Oh, you ain’t never encountered a boolean named the fucking opposite of what it does?

      • Archive@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        10 months ago

        Are you telling me you don’t like reading lines like:

        if !is_expired: refresh()

        It reads super well

      • VaxHacker@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        10 months ago

        Better: I’ve encountered a pair of booleans that appear to be exact opposites but aren’t. To protect the guilty I’ve changed the words: isOpen and isClosed, when one is true the other is false and vice versa, EXCEPT that while something can’t be both open and closed at the same time, it is possible for something to be not open and not closed.