Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I love Obj-C, but the Swift version isn't as bad as you say:

    if let myObject {
        // myObject is non-nil in here
    }
The Swift version is also usingfirst-class optionals. In Obj-C there is very small chance you'll confuse `NULL` with `nil` or `0`. Or that you'll message `nil` resulting in `nil`.. and in well-built software you have to guard against that.

Aside: Obj-C is narrowly focused on adding objects (in the Smalltalk sense) to C whereas Swift is trying to deliver a compiler and language with memory safety _guarantees_... Turns out that means you need a lot more language. Not to mention the `async` syntax/feature explosion.

Obj-C is "hippie" and Swift is "corporate suit" + "we're doing serious work here!"

Finally I want to say: I believe Obj-C was a huge competitive advantage and secret weapon that let Apple deliver an OS with so much more built-in functionality than any competitor for years and years. (Obj-C is great for system APIs) That's under-appreciated.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: