WelcomeUser Guide
ToSPrivacyCanary
DonateBugsLicense

©2025 Poal.co

(post is archived)

[–] 5 pts

If they had made it const that wouldn't have happened.

[–] 7 pts

Assignment, equivalency, those are the same riiiiight?

[–] 3 pts

Exactly!

Now this guy gets it!

[–] 2 pts

Or just enabled modern compiler warnings.

"Or just used a real language." -- C++ hater

[–] 1 pt

if(isCrazyMuderingRobot = true)

Not sure what that language is (java?) but the conditional check looks like an affectation to me, which should lead to nothing at all (compilation error)

Besides I'm not sure how that ";" after kill(humans) would work right before an else without brackets...

[–] 1 pt

It looks like C code to me. That part should compile just fine with C or C++, but although the compiler gives you a warning these days it allows you to confuse assignments with comparisons. The expression will read the value from the left side of the assignment in the evaluation. Sometimes it's convenient to do that to get some things done (Python added the walrus operator to let you do it safely), but it's usually a mistake.

[–] 4 pts

Compiler should have caught that one.

[–] 3 pts

Not everybody heeds the warnings the compiler gives them though.

[–] 2 pts

It was a warning, not an error.

[–] [deleted] 3 pts

Pajeet will still deploy code that does not compile, into prod, because pajeet.

I have seen things. It's not teradata, it's terrordata. They can crash unix.

[–] 0 pt

What kind of fucked up compiler allows assignment to evaluate to a Boolean? The conditional should have failed because setting a value should never evaluate to true or false. That's a shitty compiler/runtime.

[–] 4 pts

This is why always:

if ( true == ...

[–] 3 pts

I don't get it.

[–] 4 pts

It's a joke. I don't think it was meant to be understood by non-programmers though.

[–] 3 pts

I am a programmer. I understand the code. I just don't see what's funny about it.

[–] 2 pts

Changing something to something else you just wanted to compare with something else is never funny.

He forgot to include the {-------------D~~~~} Hash.

[–] 0 pt

In programming, = means "assign this value". == Compares two values.

[–] 3 pts

Also the fact that this code doesn't need to be written at all.

[–] 1 pt

+1 for realism, there's no way the action depicted in that cartoon could take place with such algo, isCrazyMurderingRobot remains false no matter what with that piece of code

[–] 1 pt

Took me longer to get than it should have.

[–] 1 pt

heh. = != ==

oopsie.

I bet like 99% of the people here are like "huh".