3 ms·
If it's anything like Clojure (big assumption, but skimming the submission link seems to confirm things are the same), `if` is used when you want to do somethin
by diggan 7y ago
If it's anything like Clojure (big assumption, but skimming the submission link seems to confirm things are the same), `if` is used when you want to do something OR do something else. You use `when` only when there is no `OR do something else` and/or when there is multiple things you want to do inside.
- pvinis 7y agoIt's interesting to see how you use your if and when in your sentences. Surprisingly, you have an if without an else, and a when with an or at the end! :p I do remember that convention though, and it makes sense. I just found your usages in text interesting.
- diggan 7y agoHaha, you're right! Re-reading my own comment, I seem to switch context between "normal language" conditionals where the rules obviously are different from the "programming language" context where they are strictly defined. Fun observation :)