The letter

One letter a week, starting soon.

The week's signal, what shipped, what is worth running tonight, and the editor's note. No tracking, no ads, nothing else.

We keep your address, your language and the date you joined, nothing else. Every letter has a one-click unsubscribe link that deletes the record.

← Accept All   Archive
Zenn (AI)Japan

Kotlinでは型で縛られたのに、Swiftではどうなる。Optionalとguardにベテランが戸惑った話

11.28

連載『C言語育ちのベテランが、AI片手にKotlinとSwiftを学んだ記録』第5回 第2回で書いたKotlinのnull安全に続いて、今回はSwiftのOptionalです。結論を先に書くと、こういうことです。 Swiftにも「値があるかもしれない型」と「必ずある型」の区別があります。String と String? は別物で、ここはKotlinと同じです 違うのは「ない場合の扱い方」です。

Languages & runtimes
Read at Zenn (AI) ↗

Related

More from Zenn (AI) on Accept All.