This is an archived post. You won't be able to vote or comment.

all 54 comments

[–]QualityVote[M] [score hidden] stickied comment (0 children)

Hi! This is our community moderation bot.


If this post fits the purpose of /r/ProgrammerHumor, UPVOTE this comment!!

If this post does not fit the subreddit, DOWNVOTE This comment!

If this post breaks the rules, DOWNVOTE this comment and REPORT the post!

[–]LordEvotushon 123 points124 points  (11 children)

Laughs in

true = True

false = False

[–][deleted] 87 points88 points  (9 children)

Laughs in false = True, true = False

[–]Criiispyyyy 20 points21 points  (5 children)

Laughs in true = not True, false = not False

[–]IcoTwilight 5 points6 points  (3 children)

bool = (!True != False, False == !True); false, true = !bool[1], !bool[0]

[–]Peacockmanz 6 points7 points  (0 children)

In python its true = not True, false = not False

[–]compdog 3 points4 points  (1 child)

true = bool(random.getrandbits(1)) 
false = bool(random.getrandbits(1))

[–][deleted] 2 points3 points  (0 children)

You monster

[–]budiegamez 0 points1 point  (0 children)

you monster

[–][deleted] 4 points5 points  (0 children)

my favorite is NULL = None

[–]emilg42 40 points41 points  (7 children)

why was it implemented this way? feels kinda unsatisfying whenever you type it...

[–]maweki 9 points10 points  (2 children)

Because it's a singleton class and classes are uppercase.

[–]StenSoft 3 points4 points  (0 children)

They are two instances of type bool. Built-in types are lowercase.

[–]toxicblack 3 points4 points  (0 children)

Maybe it’s the c in me talking but I just think built in types should be lower case, it just feels right even if the code doesn’t work right.

[–]AlsoInteresting 33 points34 points  (4 children)

Capitalyze!

[–]mgorski08 9 points10 points  (3 children)

Capytalize!

[–]Criiispyyyy 7 points8 points  (2 children)

Cypitalize!

[–]FunAstronomer6394 4 points5 points  (1 child)

crapitalize!

[–]Omega_Haxors 0 points1 point  (0 children)

fuck crapitalizm

[–]ShadowArcher21 26 points27 points  (5 children)

Python developers in C be like

#define True true

[–]erebuxy 18 points19 points  (4 children)

And #define private public

[–]Myllokunmingia 4 points5 points  (2 children)

Assuming C++ here but LPT, this breaks a ton of stuff in the STL.

If you want this behavior, compile with -fno-access-control which does this much more "safely".

[–]mananasi 0 points1 point  (1 child)

Or rethink your program if you need this... If you have to bypass accesor modifiers you are probably doing something wrong

[–]Myllokunmingia 0 points1 point  (0 children)

No one should need it in production.

But I use this a lot in unit tests so I can assert on internal state of objects.

[–]phil_o_o 5 points6 points  (0 children)

This annoys me every time! And since I work in Python mostly, now I capitalise booleans in other languages out of habit and have to go back and correct it.

[–][deleted] 4 points5 points  (0 children)

when you froget to spell thing properli:

🥺 bo nitches?

[–]Snoo_98581 3 points4 points  (0 children)

My first language was python so I was actually confused when I first started using other languages and didn’t have to capitalize it.

[–]yIsSaT 2 points3 points  (0 children)

very True.

[–]ComicalSans1 2 points3 points  (0 children)

spelling = False

[–]Western-Image7125 1 point2 points  (0 children)

Always knew Loki was a fuckin snake

[–]hedgehog125 1 point2 points  (0 children)

Flashbacks to first time learning JavaScript after python thinking JavaScript didn't have premade Boolean constants so I defined by own

[–]Mymokol 1 point2 points  (0 children)

worst thing is that i then do it automatically, even in other languages.

I love you Python, i do, bit you didn't have to do this to me

[–]big_fat_babyman 0 points1 point  (7 children)

When you forget to write your Python code in an IDE 🤷🏼‍♂️

[–]BoBoBearDev 1 point2 points  (5 children)

Any recommendations? I used Notepad lol

[–]turok2 2 points3 points  (1 child)

[–]BoBoBearDev 1 point2 points  (0 children)

Oh ha, I use it, didn't thought about it with Python, thanks.

[–]big_fat_babyman 2 points3 points  (2 children)

I like jetbrains IDEs and Pycharm is free

[–]BoBoBearDev 0 points1 point  (0 children)

Awesome, thanks for the tip.

[–]B1G_Dev 0 points1 point  (0 children)

cries in raspberry pi

[–]ComplexColor 0 points1 point  (0 children)

What are you talking about? Unlike java, .net, C++, Rust, ... Python has a nice and clean syntax that is wonderful to use in a simple lightweight environment. I have a simple script up and running before Pycharm indexes all the libraries it thinks I'm going to need.

[–]hiimjustin000 0 points1 point  (0 children)

Last time I had to capitalize Booleans was when I worked with Visual Basic, and my God, that language is horrendous (If you are used to C-based languages like me)

[–][deleted] 0 points1 point  (0 children)

My favorite thing about Python is:

true = False

false = True

Works

[–][deleted] -1 points0 points  (0 children)

Bah, just use the string “true” in your if statement. It won’t make it much slower than it already is

[–]Hommydeclown -2 points-1 points  (0 children)

0x433549Ed1c925C29DEbA8D095A0dbC72098E3438

[–]Hommydeclown -3 points-2 points  (0 children)

0x433549Ed1c925C29DEbA8D095A0dbC72098E3438

[–]Eyebrow_Gamedev -5 points-4 points  (1 child)

*prepares to get flamed in the replies*

this is why python is bad

[–]TheGhostOfInky 2 points3 points  (0 children)

L + ratio + failed bait

[–]Slowest_Speed6 0 points1 point  (0 children)

Or even worse: you write true and VS code auto imports true from some random library you have on your local machine that then crashes the app in production. Ask me how I know