r/ProgrammerDadJokes • • Sep 09 '20

True != False

It's funny coz it's true; ain't that some bool shit

446 Upvotes

18 comments sorted by

36

u/SurpriseMonday Sep 09 '20

Fun fact: in the earlier versions of Python (2), you could reassign boolean constants (True, False) to be whatever you wanted. Couple that with Python's built-in "variable swapping" syntax, you can write a line like "True, False = False, True" and now the bools are opposite.

30

u/arjo_reich Sep 09 '20 edited Sep 09 '20

More fun facts:

The unicode symbol for the Greek question mark looks identical to the semicolon but compilers know the difference. Try it, your coworkers will love it.

Edit: unicode not unicorn, lol

12

u/SirDumbino Sep 10 '20

That's old and well known one, try changing "a" to cyrylic "а", these are two different unicode symbols and they'll loose their minds why "bаr" is not defined even tho two lines above there is "int bar". Same shit with р о х с

5

u/gnutrino Sep 10 '20

Gotta throw a few zero width spaces in there to keep them on their toes.

5

u/NullPro Sep 10 '20

Can confirm

4

u/[deleted] Sep 10 '20

;

29

u/[deleted] Sep 09 '20

I know that i still can do this in c++.

#define true 0
#define false 1

18

u/sirxir Sep 09 '20

Laughs in bash scripting

19

u/whattheclap Sep 10 '20

alias cd=rm

3

u/SirDianthus Sep 10 '20

You are evil and i am so happy you exist.

5

u/nubatpython Sep 10 '20

alias cd="sudo rm-rf"

Make sure to set the user to nopasswd in the sudoers file first or it'll ask for password

2

u/Cootshk Sep 14 '23

You forgot a space

Gj

1

u/nubatpython Sep 15 '23

alias rm-rf="rm -rf"

1

u/Cootshk Sep 15 '23

That resets after you close bash

You have to add it to bash_aliases

113

u/IamImposter Sep 09 '20
bool shit = true;

13

u/Bross-Hog Sep 09 '20

YES!!!! Hahahahha

9

u/dmattox10 Sep 09 '20

Take my upvote and get out!

4

u/[deleted] Sep 09 '20

Sounds logical!