Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
![](/static/devrant/img/pipeless-devrant-banner-white.png)
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
lungdart323692dBest practice is to break that expression out into a function and comment the fuck out of the logic with lots of apologies.
-
donkulator225092dI've just spent several minutes wondering whether you could create booleans with real and imaginary components like complex numbers.
I have concluded that a) you probably can't, and b) I've forgotten how to do maths. -
AleCx042828492dnow look into prepositional calculus and the kind of logic you can express with things like Prolog or Clingo.
I hate it too -
@donkulator
troll && troll -> false
troll || troll -> troll
troll && false -> troll
troll && true -> troll
troll || false -> troll
troll || true -> true -
Demolishun3288692dDivide and conquer. Assign to temp variables with meaningful names of each variable. Create final expression by combining these variables into the expression.
-
cafecortado752992dI find it entertaining to try to simplify them applying Boole algebra. Truth tables, Karnaugh maps, De Morgan laws... fun stuff.
Although not always useful because the "simplified" version could make conceptually less sense. -
JsonBoa291292dFinding 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".
Related Rants
I hate complex boolean logic.
(true||false) && true || false || (true && false) ... etc (continue for at least ten clauses four times as long)
rant
dev-life
frustration
boolean logic