this post was submitted on 18 Oct 2025
748 points (99.6% liked)

Programmer Humor

26979 readers
1497 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
 

Definitely a repost, but it fits the season

top 40 comments
sorted by: hot top controversial new old
[–] noride@lemmy.zip 20 points 3 days ago

Honestly, this meme just legit helped me understand some of the tools in my CAD software.

[–] probable_possum@leminal.space 23 points 3 days ago (1 children)

Can I have everything? Inside and outside the Venn circles!

[–] codexarcanum@lemmy.dbzer0.com 53 points 3 days ago* (last edited 3 days ago) (3 children)

That would be the symbol\operation called TRUE or TOP or "tautology" which is always true. They're actually missing quite a few of the weirder ops, including implication and ~~biconditional\iff\if-and-only-if~~. (Edit: Actually I think XNOR is also the biconditional. I guess pretend like I said "material implication" and "reverse implication". Fricken booleans man!)

[–] voodooattack@lemmy.world 9 points 3 days ago (1 children)

I will save this picture because I think it’s important and will look at it while scrolling my phone a couple of years from now and wonder why I never used it all that time.

/c/justadhdthings

[–] MonkderVierte@lemmy.zip 10 points 3 days ago (1 children)

This cheat sheet needs a cheat sheet. What do the numbers with 3 numbers mean?

[–] codexarcanum@lemmy.dbzer0.com 6 points 3 days ago

I truly have no idea and wish I did, haha. It looks like a shorthand for which operation is being followed, maybe like a group theory thing, but I really don't know.

[–] NeatNit@discuss.tchncs.de 6 points 3 days ago (5 children)

I never got why "implies" is called that. How does the phrase "A implies B" relate to the output's truth table?

I have my own "head canon" to remember it but I'll share it later, want to hear someone else's first.

[–] squaresinger@lemmy.world 1 points 2 days ago

It comes from boolean logic, not from set theory (which is what it's used for here).

A implies B means that "If A is true, B is also true", so there's the implication. "If the thing we are talking about is a desk, it is also a piece of furniture".

The implication has no effect if A is not true: "If the thing we are talking about is not a desk, that doesn't say anything about whether it's furniture or not".

So the implication is only false if A is true and B is false. In any other case the implication is satisfied and the result is true.


Set theory just took over all of the boolean logic functions, since they work exactly the same in set theory, so they also took over the naming even if the name "implies" doesn't really make much sense in set theory.

[–] stingpie@lemmy.world 7 points 3 days ago (1 children)

I think 'implies' asks whether it's possible that A causes B to be true. In other words, it is false if there is evidence that A does not cause B.

So:

If A is true and B is false, then the result is false, since A could not cause B to be true.

If A and B are both true, then the result is true, since A could cause B.

If A is false and B is true, then the result is true since A could or could not make B true (but another factor could also be making B true)

If A and B are both false we don't have any evidence about the relationship between A and B, so the result is true.

I don't know for sure, though. I'm not a mathematician.

[–] NeatNit@discuss.tchncs.de 4 points 3 days ago* (last edited 3 days ago) (1 children)

Yup, that's my interpretation too. It just doesn't sit well with all the other operators.

All the others are phrased as direct questions about the values of A and B:

  • A AND B = "Are A and B both true?"
  • A OR B = "Are either A or B true, or both?"
  • A NAND B = "Is (A AND B) not true?"
  • A IMPLIES B = "Is it possible, hypothetically speaking, for it to be the case that A implies B, given the current actual values of A and B?"

You see the issue?

Edit: looking online, some people see it as: "If A is true, take the value of B." A implies that you should take the value of B. But if A is false, you shouldn't take the value of B, instead you should use the default value which is inexplicably defined to be true for this operation.

This is slightly more satisfying but I still don't like it. The implication (ha) that true is the default value for a boolean doesn't sit right with me. I don't even feel comfortable with a boolean having a default value, let alone it being true instead of false which would be more natural.

Edit 2: fixed a brain fart for A NAND B

[–] Klear@quokk.au 5 points 3 days ago* (last edited 3 days ago) (1 children)

Consider the implication to be some claim, for example, "When it's raining (A), it's wet (B)". The value of the implication tells us whether we should call the claimant a liar or. So in case it's raining (A = true) and is is not wet (B = false) the claim turns out to be false, so the value of the implication is false.

Now, supposing it is not raining (A = false). It doesn't matter whether it's wet or not, we can't call the claim false because there just isn't enough information.

It's about falsifiability (or lack thereof, in case A is never true).

[–] NeatNit@discuss.tchncs.de 2 points 3 days ago (1 children)

The comment you replied to is my response to this. It's the only boolean operation that works this way. All the others are straightforward.

[–] Klear@quokk.au 2 points 3 days ago (1 children)

I think the problem is that you're thinking in terms of boolean algebra, while implication being implication comes from propositional logic.

[–] NeatNit@discuss.tchncs.de 3 points 3 days ago

That's interesting. I'll have to read up on that. You're right, I am thinking about boolean algebra.

In the mean time though, I'll note that Boolean algebra on Wikipedia also refers to this operation, so I'm not alone:

Material conditional

The first operation, x → y, or Cxy, is called material implication. If x is true, then the result of expression x → y is taken to be that of y (e.g. if x is true and y is false, then x → y is also false). But if x is false, then the value of y can be ignored; however, the operation must return some Boolean value and there are only two choices. So by definition, x → y is true when x is false (relevance logic rejects this definition, by viewing an implication with a false premise as something other than either true or false).

It also uses the second interpretation that I mentioned in my earlier comment (4 above this one), with true being default, rather than the one we've been discussing.

[–] Excel@beehaw.org 3 points 3 days ago* (last edited 3 days ago)

“A implies B” means if A is true then B must be true; if A is false, then B can be anything. In other words, the only state not allowed is A being true and B being false. Therefore, the only “hole” is the part of A that doesn’t include B.

[–] codexarcanum@lemmy.dbzer0.com 2 points 3 days ago (1 children)

Yeah, that one's always bothered me too. I think the difference in meaning from colloquial "implication" and logical "material implication" are also involved in the raven paradox.

So the statement that "all ravens are black" can be taken as "if RAVEN then BLACK". Is this statement true? If you see a black raven then trivially yes, if you see a white raven then trivially false (via counter example).

However if you see a non-raven, it is evidence for the truth of the statement because it doesn't go against it: not-ravens being black-or-not-black both reduce the universe of possible objects without proving not-black-ravens exist.

Or something like that, I think it's stupid too. Trinary logic can adopt a more sensible (IMHO) definition of implication that makes A being false always lead to the third value (usually defined as indeterminate or neither-true-nor-false).

[–] squaresinger@lemmy.world 1 points 2 days ago

The AND and OR also have slightly different meanings than in "real life". That's what always happens if you use natural language terms in the context of formal languages.

In English (and many other natural languages), "or" means either XOR or OR, and "and" can also mean OR in some contexts.

So it just follows that IMPLIES doesn't mean the exact same as "implies".


To take your example with the ravens: IMPLIES is just about whether the inputs contradict the statement. The statement "raven IMPLIES black" should be translated to "raven is black", not "all ravens are black", since you only ever test the statement against specific inputs.

So if you now give it "raven" and "black" as inputs, the statement is true. If you give it "dove" and "white" as inputs, it doesn't contradict the statement, so the result is still true. Only if you give it "raven" and "white" as inputs does it contradict the statement.

Remember: Boolean logic isn't about statements of truth, but instead as a mathematical operation. Same as you use mathematical functions and operators to "calculate x", you also use boolean operations to calculate a result.

[–] Speiser0@feddit.org 1 points 3 days ago (1 children)

"A → B" is true in any variable assignment where B is true if A is true.

It has always been mostly obvious to me.

[–] NeatNit@discuss.tchncs.de 1 points 3 days ago

Yeah, that kinda works but I don't like it. See my reply to the other comment.

[–] notsure@fedia.io 13 points 3 days ago

...goddamn programmers...

[–] enbiousenvy@lemmy.blahaj.zone 8 points 3 days ago

my logic is too weak to be able to make sense why those are they way they are, I just brute force each of them until I found which one I need when working with that in Blender shader nodes.

[–] _druid@sh.itjust.works 9 points 3 days ago

I'm looking for a truth table, like a child lost in a supermarket.

[–] captain_aggravated@sh.itjust.works 5 points 3 days ago (2 children)

There's another one possible: Trick NOT Treat.

[–] silasmariner@programming.dev 3 points 3 days ago

There's another 10 possible, but if retaining symmetry and excluding the trivial T/F cases, these 6 are the ones to show I guess.

[–] Lifter@discuss.tchncs.de 1 points 3 days ago (1 children)
[–] captain_aggravated@sh.itjust.works 1 points 3 days ago (1 children)

how would that be different than Trick NAND treat?

[–] filthy_lint_ball@lemmy.world 1 points 3 days ago (1 children)

"(!Trick) && Treat" is probably the binding they meant

[–] captain_aggravated@sh.itjust.works 1 points 3 days ago (1 children)

Or to simplify, Treat NOT Trick?

[–] Lifter@discuss.tchncs.de 0 points 2 days ago (1 children)

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 0 points 2 days ago* (last edited 2 days ago) (2 children)

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

[–] captain_aggravated@sh.itjust.works 2 points 2 days ago (1 children)

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 days ago (1 children)

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

[–] captain_aggravated@sh.itjust.works 2 points 2 days ago (1 children)

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 days 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 days ago

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

[–] lugal@lemmy.dbzer0.com 6 points 3 days ago

Or it's closer to Trick XOR Treat or, if we are realistic, Trick NAND Treat

I think I might have grown up "Trick XOR Treating" rather than "Trick OR Treating." If I remember right, it returned "False" for "True" values of both "Trick" and "Treat" but not either and not none.

[–] blindsight@beehaw.org 4 points 3 days ago (1 children)

XNOR is so ambiguously named.

Every time, I'm like: The inverse of XOR? Or the inverse of NOR? Oh, right, NOR is already the inverse of OR, so X-NOR is just OR, so XNOR must be the inverse of XOR.

[–] MarauderIIC@lemmy.zip 1 points 3 days ago

It's NOR, but the blank spots (because "N"OR) are exclusive - the blank spots can't overlap.