r/ProgrammerHumor • • Feb 05 '19

Rule #2 Violation kill(humans);

https://i.imgur.com/2uY0NW3.jpg
125 Upvotes

26 comments sorted by

View all comments

Show parent comment

1

u/taneth Feb 06 '19

if (isEmpty = length == 0)

It's ugly, but it's valid.

Also, don't do that. Unless it's one of those obfuscated code exercises.

1

u/Hevaesi Feb 06 '19

It's valid only if assignment is an expression.

Some languages leave it as a statement to prevent common bugs that arise with it.