It’s been just over two years since Apple announced it’s brand new language, that was destined to become the new standard for their platforms. Like many things from Apple this was something they’d been working on for two years already. It was WWDC 2014 and I was taking a break from writing code (Objective-C) and excited to hear all the new announcements. Then it happened, they announced a brand new programming language that would change the world. I was on the fence. Of course all the benefits and performance claims sounded great, but it all remained to be seen. The media went wild with the news, many praising the effort but many more that were not happy. This wasn’t the first time that an Apple announcement had stirred up emotions and sometimes even divided people into opposing camps. It’s actually a major part of what makes the Apple community so great. This time around it was very different. First, this only really affected developers and created a lot of questions about what this would look like over the next few years. I was amongst them, concerned that I’d spent the last 5 years writing Objective-C. Did I now have to embrace this? Would it be a forced change, leading to deprecation of my beloved language. I’d grown very fond of it’s uniquely boxy syntax and verbosity. I’d wrangled many a bugs and written beautiful code that Iwas very proud of. It was my first real programming language, where I wielded great power and understood the responsibility of having such abilities.
At first glance I dismissed the newcomer, confident that Objective-C was here to stay for a while before Swiftly gained any real traction. Out of curiosity of Swift and an interest in checking out these new Playgrounds, I took some time too play with the language. The syntax was very similar to what I’d already been writing in node.js and I did like that, since my biggest complaints about JS were lack of strong typing and compile time errors. After fiddling around with a few basic swift programs in Playgrounds, I could see the benefits of writing native software in such a lightweight syntax, but was still a bit hesitant to embrace it. Shortly after, there was lots of chat around swift from language designers and all sorts of people way smarter than me. Many more of them were complaints vs praises. I’d experienced my own issues when I attempted to do typical things that were part of everyday iOS development, like setting up a UITableView with a datasource and delegate. This is we’re things starting looking really bad for Swift. The interoperability with Objective-C provided access to the frameworks but it wasn’t a pretty sight. The verbosity of the APIs were completely lost and the syntax of swift made things difficult to read or follow. I understood this was version 1.0 and it’s expected to have issues, but it was enough for me to abandon the effort. I decided to hold off until it matured a bit. This worked out well for me as I held off until version 2.0 and the changes were major. Version 2 offered a clearer roadmap to where things were going. The original goals remained intact but it was getting smarter and interoperability with Objective-C was much cleaner. Amongst the highlights that accompanied the release, Apple made a promise to open source the language by end of the year. They made good and over delivered on that promise. Not only did they open source the language, they released an open source version of Foundation and support for Ubuntu. They also laid out the entire plan for the future of Swift, embracing the community through a public project called swift-evolution where proposals for changes to the language can be submitted by anyone. These proposals are reviewed and discussed by contributors inside and outside Apple, before being added officially. The work done through this process was slated to be part of version 3, which would also include a Package Manager and become a major step toward making swift a truly portable language. Some of the changes have restored the ability define clear and concise method names.
That’s just the beginning, Apple and many others are investing heavily in Swift. IBM has built and release several solutions to support bringing Swift to the cloud, recently open sourcing a Web Framework for developing web applications purely in Swift. They are not alone there are about 30 others, like Perfect who pioneered the space with their solution. I’m personally taking a liking to newcomer Vapor, which so far in my experience has been pretty solid and the maintainers are very helpful on their Slack. As someone who’s written a lot of node.js applications,, it’s a delight to use and I’m looking forward to using it in production, once the dust settles on Swift 3.0 and all the packages finally move from beta to 1.0. It’s a very exciting time.
To return to my point of this article and explain the title, there area number of contributing factors that are indicating that Swift will be the winner in the not to distant future. Besides having a super approachable syntax that makes it easy to learn. It has some pretty powerful features that make safer, faster and extremely flexible in ways very few languages can do period, but no others that do them all. It supports multiple programming paradigms, meaning you can leverage object oriented, functional, reactive, procedural or whatever suits your needs in the same application. Did I mention it’s extremely extensive? That’s a massive understatement. Then there’s the number of resources available to learn Swift has exploded. You can find plenty of videos on YouTube, lots of dedicated blogs and newsletters. Even the upcoming iOS 10 release will come with Swift Playgrounds for iPads. It’s an app Apple developed that turns learning Swift into a game for all ages. I’ve played with it and it’s amazing. I can see the beginnings of an Xcode running on iPad. Apple’s also offering Swift boot camps for Kids at Apple Stores this summer. The community is also growing rapidly, there are countless developer resources popping up every day. The combination of these things indicate to me that the future generation will be writing in Swift. I think in the next few years it will be the language used for all Comp Science courses at colleges and high schools ( and hopefully much earlier). It will also become choice language for mathematical and scientific projects because over Python. Backends will be written in Swift more often than other options available today and building development teams will become easier as Swift developers become generalists that can build any type of software needed vs need lots of specialists.
I said before and I’ll say it again: The future of code will be written in Swift!