Comment Re:ObjC to Swift, 4 years in (Score 1) 262
This.
HUGE fan of Objective-C, back from the NeXT days. Been writing iOS apps since ARC was optional and I never used it, because *I* knew how to alloc and free memory. Yeah, that meant it was a pain in the ass when Apple made ARC a requirement.
I miss introspection, sure. But optionals, tuples, native unicode support, default parameters, conditional generics, and a consistent calling syntax just makes my life easier. Add to that first-class immutable structs, better functional programming support, and stronger exception handling, and I just enjoy programming Swift more than Objective-C.
It's not like dynamic dispatch went away -- it just got shuffled to object extensions.
That said, there are some things I don't like about Swift: lack of introspection (as I admitted), and especially still using ARC for memory management. While it may be fast, resolving retention cycles can be difficult, especially if one half of the retention is in some Cocoa library.
Swift doesn't lock you into Apple products. It's an open-source language, for cryin' out loud. What locks you into Apple products are the libraries you use to target a specific platform. Just like MFC locks you into Microsoft products.
I can see why some people might prefer Objective-C. I still look on it fondly as the best of the C-based OO languages. Hell, I still love programming in straight-up C.
I'm just glad I made the jump to Swift.
Oh, I'm also moving to Kotlin for my Android projects for many of the same reasons.