788
Trick XOR Treat (lemmy.dbzer0.com)

Definitely a repost, but it fits the season

you are viewing a single comment's thread
view the rest of the comments
[-] Lifter@discuss.tchncs.de 1 points 2 months ago

Yes, but I saw changing the order of them as non-compliant with the meme. I could have added a parenthesis but that also felt too technical.

[-] Lifter@discuss.tchncs.de 1 points 2 months ago

Is there a standard order of operations for boolean lohic, such as PEMDAS is for arithmetic?

[-] captain_aggravated@sh.itjust.works 2 points 2 months ago

That's an interesting question, and I'm gonna go learn the answer.

duckduckgo powers activate!

So yes, they do. It generally goes NOT, AND, OR. And if you're doing algebra in binary and you've got boolean operators in there (you can AND two numbers the same way you can ADD two numbers in binary) PEMDAS becomes PEMDASNAO.

[-] Lifter@discuss.tchncs.de 1 points 2 months ago

Nice, so my gut feeling about not needing the parenthesis above was right.

[-] captain_aggravated@sh.itjust.works 2 points 2 months ago

I store-brand googled it, so I feel I'm not an authority to say one way or another!

[-] silasmariner@programming.dev 1 points 2 months ago

It's a reasonable convention that matches the common DNF (disjunctive normal form) of propositional logic, can confirm it's the right read.

I'd still probably use parentheses for the ∧ (and/conjunction), though I'd never bother with it for ¬ (negation)

[-] Natanael@infosec.pub 1 points 2 months ago

That's language specific. In math it's mostly just a parenthesis

this post was submitted on 18 Oct 2025
788 points (99.2% liked)

Programmer Humor

27963 readers
1515 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS