3 ms·
Exclamation mark for optional is just weird. Question mark would be a lot more intuitive, unless there’s an origin story here I’m not aware of.
by oefrha 7y ago
Exclamation mark for optional is just weird. Question mark would be a lot more intuitive, unless there’s an origin story here I’m not aware of.
- angry_cactus 7y agoNot sure of the exact motivation, but Swift uses exclamation mark to unwrap optionals.
- oefrha 7y agoIn Swift optional types are marked by a question mark (exactly as I suggested). Unwrapping an optional makes it non-optional, so the exclamation point has the opposite meaning.
- yusufnb 7y agoIts updated now to work with ? syntax