Where to start

So I purchased books and some online courses a while back to learn Objective C and start coding apps but never had the time to do anything with it.. I'd like to pick up where I left off, but curious where to start. I know Swift was introduced and I'm wondering if I should scrap my old books and start over with Swift, or continue on the path I was using before? Is Objective C still used, required, etc.? I don't feel heavily invested in it that I'd lose anything if I started over in Swift if that's the way to go..


-Keith

It's perfectly fine to continue using Objective-C. It's still relevant, still valid, and still supported, even in the brand-new watchOS and tvOS platforms. Obj-C continues to be updated and modernized, so if you've been away from it for more than, say, three or four years, you will have to do some catching up. Garbage collection is gone, replaced by a compile-time feature known as Automatic Reference Counting, properties are now automatically synthesized by default, you can place instance variables under an @implementation header, there are new nonnull and nullable keywords that mirror Swift's optionals feature, and more. That's just the language; massive changes have also been made to Cocoa and Cocoa Touch in the last four years or so.


So you're welcome to use whatever you feel most comfortable with. In any case, I recommend you look up the "what's new" documentation from both this release and several older ones so you're all caught up with current practices.

Thanks Bob.. I guess what I should have asked is.. if someone completely brand new came along with no C, Objective C, or other experience.. but had background in other languages / scripting.. what would today's reccomendation be to start them off with? Objective C still? Or just move on to Swift?

-Keith

For someone who is starting from scratch, I would recommend Swift. But since you already know Obj-C, it's perfectly fine for you to continue using it. I still use Obj-C too.

Be careful with old books - they may contain outdated references, so eyes open.


As for Obj-C & Swift, I'd either keep going with the former or do both. Remember that Swift is still early, so expect it to be in flux for a while.

I'd say Swift is here to stay, and Obj-C will be pushed on its way out (not anytime soon though !), so for someone wishing to learn developing apps today, I'd recommend Swift.


Here are some pros / cons for using Swift :


+ HUGE gain of productivity over Obj-C : less code, less housekeeping, and some really useful tricks only available in Swift (#available, guard, defer...)

+ Apple provides a free iBook for learning Swift development, which only focuses on the standard library and is very good.

- You'll find less documentation and topics on StackOverflow about problems you could encounter with Swift that in ObjC, although most problems are related to Cocoa Touch, so you'll just need to "translate".

- Swift runtime is embedded into your app for compatibility purposes, meaning that an app using Swift will weigh (much) more than its Obj-C counterpart.

+- Swift is still under active development, and you must expect changes to come very quickly. I personnally find the additions of Swift 2 to be gamechangers.

+- Compiler is harder to "trick" when using Swift, as the language seems more static and less permissive than ObjC ; it also means it's much (much) safer.


Ultimately, I think that the hardest and longest part of OS X / iOS programming is about learning system frameworks and their best practices ; that doesn't depend on the language you're using, so really, you won't be screwed if you decide to go with Swift and fall back to ObjC (or the other way around).


Hope that helped a little... (please forgive my english !)

Thanks Rezard, that was very informative! (And your English is just fine!)

-Keith

Where to start
 
 
Q