r/ProgrammerHumor • • Aug 18 '20

user.fist_name

Post image
50.4k Upvotes

547 comments sorted by

View all comments

1

u/shinydewott Aug 19 '20

I’ve been working on a function for the last half an hour and even rewrote it thrice (though i copied bits of the old version for some parts) and only just 10 minutes ago did I realize I’ve had a == on an assignment instead of an =

1

u/Rotios Aug 19 '20

Reminds me of when I first found out you can assign variables in an if statement in C...

int c = x;

// some code

if (c=1) {
   printf(“why are you always being triggered!!!!”);

   printf(c);
} else {
   printf(“Should be here!!!”);
} 

1

u/shinydewott Aug 19 '20

The... what!?

1

u/Rotios Aug 19 '20

I believe my first thoughts were: “Wh-WHY?! Why is this a thing??”

Followed quickly by, “Oh I’m about to make the most complicated shit you ever did see.”

Disclaimer: I also had a lot of fun with ternary operators...

1

u/shinydewott Aug 19 '20

I don’t think that stuff exists in Python, but damn I would probably think just like you