3 ms·
Why is this explicitly testing for false: if defaults.boolForKey("launchBefore") == false { rather than: if !defaults.boolForKey("launchBefore") {
by mjmsmith 11y ago
Why is this explicitly testing for false:
if defaults.boolForKey("launchBefore") == false {
rather than:
if !defaults.boolForKey("launchBefore") {
- holyjaw 11y agoProbably a style thing. I think I recall reading about this in one of his Swift or Objective-C books? Can't quite remember. EDIT: Or maybe even just a hastily typed example code
- florian_buerger 11y agoI use this style myself. It is way easier to read than `!condition`. If you are scanning the code, a single `!` at the beginning of the condition won't stand out that much.