Negating compound boolean expressions (De Morgan's Laws) (pawelgrzybek.com)
from codeinabox@programming.dev to programming@programming.dev on 12 Nov 11:04
https://programming.dev/post/40624826

#programming

threaded - newest

MagicShel@lemmy.zip on 12 Nov 13:46 next collapse

Boolean Algebra is one of the few things I learned in electronics that I still apply in programming all the time.

thingsiplay@beehaw.org on 12 Nov 14:31 collapse

!(r.SendNow || r.DryRun) requires you to read the entire statement and then negate the result. While !r.SendNow && !r.DryRun each part of the statement stands on its own and is negated for themselves. That is how I read. I like the Ai suggestion more, because that is how I would write it myself. What I like about it is, that the negation of is right there with the variable. It gets more important, the more you divide sub-expressions in multiple lines.