My favorite part of the WWDC 2014 keynote starts at the 104:35 mark. Craig Federighi teases the notion of changing Objective-C, creating a huge buzz in the audience. Then he drops the bomb - a whole new language. And the crowd goes wild. (And how much fun must it have been to be Craig right then?)
I hate hate hate Objective-C. Always have. C was my third programming language after BASIC and Pascal, but it was my first love. I loved how concise it was, how expressive, and how I could practically see the machine code it generated. Objective-C’s extensions made it look messy, unfamiliar, a different language entirely. Don’t get me wrong, I hated C++ too. And Java. They all seemed like messy steps in the wrong direction (or, rather, three wrong directions). That trio of C replacements actually scared me away from development for many years.
What brought me back was C#, the thinking man’s replacement for C. C# started off pretty clean and actually got cleaner with every revision. I started coding again, using it to write the first and second versions of Unshelved.com. But the ASP.NET framework was not as pretty as the language it utilized.
Then DHH wrote a web framework called Rails using an obscure language called Ruby, and changed everything. The dynamism of the language made for a very concise, very expressive take on writing websites. Microsoft eventually came back with ASP.NET MVC, which I used to write the third version of Unshelved.com (which cohosts with notinventedhe.re). This was a good try, but even with the beautiful piece of technology called LINQ it couldn’t really keep up with Rails or its open source community. I became a Rails programmer, and in my capacity as an independent contractor created several websites for a friend’s company. I really like coding in Ruby.
For years I’ve been wanting to write iOS apps but Objective-C scared me away. I played with RubyMotion a bit, but it felt like one of those things where I’d be continually hamstrung by not understanding the language the APIs were written in. I was pettily determined never to learn Objective-C.
Swift brings everything back around. Just hours after it was announced I was reading the manual on my iPad on the plane home from NYC to Seattle. It’s a great language, a beautiful merging of C# and Ruby and several other languages I don’t know. Again and again, as I read the book, I saw where the syntax was optimized to make common pain points go away. And, coming from Apple, and clearly intended as a first-class peer to Objective-C (which will sadly still be around for many years to come), there will be no hamstringing. The API docs already reflect both languages. It’s a no-brainer. I’m already planning the iOS apps I’m going to write, starting with making some simple SpriteKit games with/for my kids. And clearly I’m not the only one. Twitter is full of folks excited to come on board with iOS now that the hurdle of Objective-C is gone, replaced by the newest, best-to-date inheritor of the C crown.
But what has me in awe is not that Apple made a great thing. It’s that they kept it secret for four years. Just think about that. While people like me were bitching about Objective-C, they stayed silent. While actual Objective-C developers struggled with the limitations of the language, they stayed silent. They didn’t make explanations. They didn’t tease concepts. Objective-C was their full-hearted answer until the moment it wasn’t anymore.
I know I couldn’t have done it. I couldn’t have slaved away silently at such a thing of beauty, knowing how happy it would make people, the problems it would solve, for so long. (It probably helped that iOS wasn’t exactly hurting for developer support in that time. Folks more motivated (and less petty) than I learned Objective-C even if they didn’t want to, used it even if they didn’t like it.) But still. They held this card incredibly close to their chest until it was ready to be played.
What other cards are they holding?
Full disclosure: I own a bunch of Apple stock and buy more whenever possible.