8

I hate complex boolean logic.

(true||false) && true || false || (true && false) ... etc (continue for at least ten clauses four times as long)

Comments
  • 8
    Best practice is to break that expression out into a function and comment the fuck out of the logic with lots of apologies.
  • 1
    now look into prepositional calculus and the kind of logic you can express with things like Prolog or Clingo.

    I hate it too
  • 5
    State machines? Anyone?
  • 2
    @donkulator
    troll && troll -> false
    troll || troll -> troll
    troll && false -> troll
    troll && true -> troll
    troll || false -> troll
    troll || true -> true
  • 0
    @Demolishun exactly! πŸ‘Œ
  • 0
    Yeah I agree. But this one evaluates to true. Just sayin' 🀷
  • 3
    Finding a way to easily solve loooooong boolean equations is literally the way to solve most of the hardest problems known to humanity.
    Not kidding, this sucker is an NP-Complete, offer referred to as "Satisfiability Problem", "SAT", or, more often, "that bitch".
Add Comment