$ ./guess_the_languageProgramming Languages
Programming Languages · hard · #551

Which programming language is this?

func divide(_ a: Int, by b: Int) -> Int? {
    guard b != 0 else { return nil }
    return a / b
}
let half = divide(10, by: 2) ?? 0

Answer: Swift

Unlike Kotlin, it uses func, the _ and by argument labels, a -> Int? return arrow and guard ... else, which are Swift.
Play Programming Languages ▸