logoalt Hacker News

willtemperleyyesterday at 2:15 PM1 replyview on HN

I'm surprised, guard is really useful, especially when unwrapping optionals. It's terse, explicit and encourages defensive programming.

internal should definitely go though.


Replies

cosmic_cheeseyesterday at 2:32 PM

The absence of guard in Kotlin is one of those things that regularly trips me up when bouncing between it and Swift. Rather than Swift losing guard I’d prefer if Kotlin gained it.

show 1 reply