Swift

Just shy of two weeks ago, Apple announced their new programming language Swift at WWDC. Apple stated that Swift was Objective-C without the C, and presented it as where things are moving. It is a very exciting time for Apple developers in general, and this new language is just the tip of things. So of course, I dove right in!

I’ll state right off the bat that I have mixed feelings about Swift. As I1 quipped on Twitter, it’s not just Objective-C without the C, it’s Objective-C without the Objective-C2. The language makes a number of tradeoffs that I feel are questionable. It involves concepts that sound great on paper, but in practice likely won’t work out (how many programmers do you think will actually bother to properly check optionals before !‘ing them? I will, and I know you will, but what about Bob down the hall?).

That said, there is a lot to like about the language, and a lot to be excited about. Pointers are hidden away so we don’t have to type the asterisks anymore. Enumerations in Swift are a vast improvement over anything offered by the C family of languages. Tuples are first class members of the language (of course they will be abused to return errors along with results, but you have to take the good with the bad).

Unfortunately my current day job doesn’t involve Objective-C or Swift, so I’ve only had the opportunity to use it on the evenings and weekends. Still, this has been enough time to completely convert a new project that I recently started from Objective-C to Swift. In the process I came across a number of issues with the language to report to Apple, which I’ve listed below in no particular order:

I also have a handful more that I am still digesting a bit before reporting them.

If you look through those, it’s very apparent that I have some strong disagreements with many of the decisions made in the design of the language. Most of them are unlikely to be addressed in a way which satisfies me, but that’s ok. I reported the issues because I like the idea of Swift and the initiative Apple is taking by introducing it, and I want it to be better. And while Apple is busy either fixing or discarding my issues, I will do what I always do: program in whatever language seems best suited to the task at hand, be that Objective-C, Swift, or something else.


  1. And I’m sure many others.
  2. Really, it’s like Objective-C through the eyes of someone who has maybe seen a lot of Objective-C, but produced almost none of it.