To Objective-C or not Objective-C

swift-book-150x150It has now been almost two weeks since Apple released the Swift programming language and after the initial hoopla and everyone chiming in on what language it most resemble, and as the euphoria begins to settle and realization begins to finally sink in, I am seeing two camps with opposing views as to what should you learn first.

Drew McCormack tweeted “Intriguing that non-devs seem to perceive learning Swift as being much easier than Obj-C. I guarantee it is much, much harder. C++ hard.” see his tweet. The tweet has gotten quite a response.

And yesterday, June 11th, Aaron Hillegas, blogged that “iOS Developers Need to Know Objective-C”, (read his blog here) and by reading the comments left on the blog, it got quite heated, vocal and accusatory. Aaron has authored numerous books on iOS development.

On the other hand, we have newcomers, who look at Swift and have fallen in love at how ‘easy’ and ‘readable’ Swift is. Some are comparing it to JavaScript, others to Scala, Haskell and Rust. Clearly, Swift ‘borrowed’ heavily from all theses different languages and others, as stated by Chris Latnner on his webpage. And Apple’s Xcode playground, makes Swift look like an leisurely afternoon walk in a balmy day in Central Park.

This battle fronts remind me of old Apple Windows ads of “Hi am a Mac, Hi am a PC”, but now we have “Hi, am a Swift Programmer, Hi am an Objective-C programmer”. (Maybe I can get my crew to come up with some clever sarcastic videos depicting said programmers).

What do I think?

There is an element of truth to the fact that you need to have some prior experience in programming in order to dive into Swift. I have been looking at it for a week now just like all of us are doing at the moment, and I have to say, that I find some of the language semantics easy on the eye, some others, not so much. Don’t get me started on the notion that you can use emoji’s as variable names. Just how many poop emoji variables can one have in a page. Yet, it makes the integration with the cocoa and other frameworks more palatable. And that is the point, I think that just ‘learning Swift’ is not going to make you an Mac or iOS developer. It is about the framework and learning Cocoa, SpriteKit, CloudKit and the hundreds of other Objective-C frameworks out there to integrate with Swift is what I think is necessary. And lets not forget the millions of C++ lines of existing code out there (on top of the other million Objective-C code), as well as pure raw “C”.

All hail the great “C” language which is almost nearing 50 years of age and it wont die. (oops sorry I digress).

If you want to be an iOS/MacOS programmer and want to write super cool apps, and If you don’t know what NSWindow, NSObject, NS…. is, well then, Swift is just going to be just as useful as a Zambonie at a Football field. During WWDC, Nate Murray wrote a Flappy Bird clone within 24 hours of Swift being released, calling it FlappySwift. (click here for git). Am pretty confident that Nate knows his Cocoa Frameworks pretty well, and am willing to sate, he knows his Objective-C well enough to have gotten FlappySwift off the ground in hours.

The barrier to Mac development got easier (?) with Swift, but there are all the intricacies we have come to love/hate over the years that we have had to struggle with and learn. The new crop of Mac developers (new being the key word here) who will think using Swift is going to be easy, are in for a quite a treat. And don’t get me wrong, I am as enthusiastic about Swift as all of you are, but some of my thoughts here are based on my experiences as a developer.

I could go on, what do you think of developers learning Objective-C first then Swift, or vice-a-versa?

Thoughts welcomed,

 

Carlos.