this post was submitted on 02 Oct 2023
7 points (88.9% liked)

Programmer Humor

32000 readers
1744 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

Hi guys, I know this is kind of an odd request, but I need your help.

I just got invited to a Halloween Party by good friends and I'm really not big on the costume stuff. I usually just wear a piece of paper around my neck with some sort of "joke" on it.

So there will be a lot of programmers and computer scientists at this party and that's where I need you guys help. I need ideas for cheesy Programmer Humor kind of oneliner jokes I can easily fit on a normal piece of paper.

I'm kinda looking for stuff recognisable by most, but too niche for me to come up with it myself.

I have none to superficial understanding of programming languages, but I really don't need an explanation of the joke. If sb asks, I'll just come up with something.

I hope you guys can help me out with that.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 0 points 11 months ago (2 children)

if CanReadThis = true { TooClose = true }

Feel free to make it look like proper code lol, I don't know how to program :P

[–] [email protected] 2 points 11 months ago (1 children)

Most programming languages uses = to copy a value into whatever whatever you put on the left side. You did it with TooClose, which you set to true.

But when you compare values as you do with the if statement, you need another operator, otherwise CanReadThis will be set to true and the if statement will always run (or syntax error), making it unnecessary.

Compare operators are typically == and/or === and some languages uses their own like ‘eq’ or other exciting ways.

Languages and compilers works in different ways, but your program could look like this. (When comparing a Boolean you don’t need the operator, you can just write the variable since it’s either true or false)

If (CanReadThis) { TooClose = true; }

[–] [email protected] 2 points 11 months ago

Lol ty for the help!

[–] [email protected] 2 points 11 months ago (1 children)

Decided to write it in python for brevity.

if you.can_read_this():
    you.is_too_close = True 

though if you know what you're doing, you'd be more likely to do something like

you.is_too_close = you.can_read_this()
[–] [email protected] 1 points 11 months ago