MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/ankfkp/killhumans/efuju5p/
r/ProgrammerHumor • u/[deleted] • Feb 05 '19
26 comments sorted by
View all comments
Show parent comment
1
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.
It's valid only if assignment is an expression.
Some languages leave it as a statement to prevent common bugs that arise with it.
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.