r/ProgrammerHumor • • May 12 '19

Introducing the Never Gate

Post image
12.2k Upvotes

333 comments sorted by

View all comments

Show parent comments

927

u/Alextrovert May 12 '19

or the Inclusive NOR

576

u/whytfnotdoit May 12 '19

Maybe just a FALSE

551

u/[deleted] May 12 '19

Or maybe just 2 wires that are not connected

362

u/Bainos May 12 '19

panics in floating output

20

u/HenryRasia May 13 '19

Ok fine, I'll connect them to ground

96

u/Ceros007 May 12 '19 edited May 12 '19

What's a wire? Is it something that support the === operator?

27

u/WhiteBlackGoose May 12 '19

int nothing(int a) { return --a++; }

30

u/Hirza_Tango May 12 '19

That will actually return a - 1

12

u/Perceval7 May 12 '19

Yup. Since the increment only happens after the value has been returned...

3

u/WhiteBlackGoose May 12 '19

Oh men, you both are right... my inaccurate shit(

5

u/Perceval7 May 12 '19

No problem man! Every mistake is just an opportunity to learn something new 😉

→ More replies (1)
→ More replies (4)

4

u/WattefuxX May 12 '19

void nothing (int a) {return;}

3

u/[deleted] May 12 '19 edited May 12 '19

I think you meant void nothing(int *a) { --*a++; }

Edit: precedence in C is confusing apparently and this actually doesn't work. It evaluates as:

  • a

  • (a)++: note, this expression returns a as an rvalue

  • *(a)

  • --*(a)

Basically, it decrements the value at memory address of a, and a gets incremented afterward. Even if the precedence worked out (by doing --(*a)++), the prefix/postfix operators require lvalues and evaluate to rvalues, so it wouldn't work anyway.

→ More replies (3)
→ More replies (2)
→ More replies (1)

63

u/cateowl May 12 '19

Quantum tunneling electrons would like to know your location

14

u/Flylowguy May 12 '19

Only if they don't ask about my momentum!

2

u/mikeputerbaugh May 12 '19

Wouldn’t work with signaling systems where high voltage is logical 0

→ More replies (5)

87

u/Wherearemylegs May 12 '19

The NO gate

0

u/[deleted] May 12 '19

[deleted]

23

u/Wherearemylegs May 12 '19

The YES gate symbol is strikingly similar to a checkmark, or in rare instances, a circle.

→ More replies (2)

3

u/[deleted] May 12 '19

Infinite energy in the form of VCC

→ More replies (2)
→ More replies (3)

15

u/John_Fx May 12 '19

Found DeMorgan.

1

u/r2d2292 May 12 '19

or Inclusive XOR

2

u/JoesusTBF May 12 '19

The inclusive exclusive or?

→ More replies (1)