@nicklockwood
Yeah, I have deeply mixed feelings about this particular language decision. Either choice is so obviously wrong.
Conversation
Notices
-
Embed this notice
Paul Cantrell (inthehands@hachyderm.io)'s status on Friday, 24-Jan-2025 02:30:20 JST Paul Cantrell
-
Embed this notice
Nick Lockwood (nicklockwood@mastodon.social)'s status on Friday, 24-Jan-2025 02:30:21 JST Nick Lockwood
It has been 0️⃣ days since I got bitten by a bug caused by forgetting to set an optional var in a Swift struct due to the synthesized init defaulting it to nil.
Reminder: you can avoid this by declaring it as:
struct Foo {
var bar: Optional<Baz>
}Instead of:
struct Foo {
var bar: Baz?
}
-
Embed this notice