Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
pasquinelli
9y ago
0 comments
Share
how would you write a yoda conditional with two variables? which is the yoda conditional (a == b), or (b == a)?
0 comments
default
newest
oldest
mikeash
9y ago
You can't if they're both mutable, since the whole idea of a yoda conditional is to put an immutable thing on the left side. What I meant was that you can't use them in that case, so it's a technique you can't use with 100% consistency.
j
/
k
navigate · click thread line to collapse