Apple's programming language Swift has developed rapidly and become very popular among developers. New apps for iPhone and iPad are built in Swift. The App Academy has therefore decided to change their focus predominantly on Swift, because it's to become the default in the iOS developing industry.
"Students pick it up easier and it takes less effort to understand how to build an app." Headmaster Axel Roest lectures about computer science, programming history and explains the benefits of Swift.
Now that Swift is becoming more and more popular, does that mean the end is near for Objective-C?
"No, that's definitely not the case. Swift, Apple’s new programming language, is especially important for mobile app development. Swift has taken off faster than anyone had imagined. On Github, the famous web-based Git repository hosting service, Swift is number one with more than 20,000 people starring it.
Number two on that list, Rust, has to do it with more than 14,000 stars. That really shows how popular Swift has become among software developers in a short time, because Swift has only been around since June 2014. Since December 2015 it has become open source and really stable as a programming language. A lot of new apps are written in Swift and with that gave a boost to a new generations of developers."
What is Objective-C currently still used for?
"95% of Apple's other software products are still written in Objective-C. There is also a long relationship with that language of course. Let me give you a little history lesson: Steve Jobs is kicked out of Apple in the 80s and develops the NeXT computer running its own operating system NeXT. In the late 90s, Apple buys NeXT and Jobs is CEO again. Apple then has a strong need for a new operating system and uses NeXT, developed in Objective-C, which leads to the birth of OSX. That’s the reason why Objective-C plays an important role within Apple. OSX, iOS, WatchOs and tvOS are all written in Objective-C."
But why did Apple come up with a new programming language like Swift?
"The syntax of Objective-C strikes fear into some programmers, because it looks different than, say, Java and C++.
In Java you would write for example: john.getCoffee(3, 2). It is unclear without reading the documentation what the 3, 2 stands for.
In Objective-C this would look like: [ john getCoffeeAmount:3 withSugar:2 ]. In short, the format is very different.
Swift is a hybrid between the two syntaxes. It then looks like this: john.getCoffee(amount: 3, withSugar: 2). So the syntax looks familiar, and is also easy to read.
Another reason is that Objective-C is designed to be compatible with the programming language C. Therefore, you can’t just make changes, because C should still understand what is happening. To Chris Lattner, software developer and an expert in the field of compilers at Apple, that felt very awkward. In his free time he started around 2010 to write a new language and that became Swift."
Is Swift an easy to learn programming language?
"It is easy to learn for people with little programming experience. The syntax is easier to read than, for example, Java. In addition, there’s a strict compiler for the language. A compiler inserts your code into an application and if there’s something wrong, it doesn’t work.
You have to see it like this: the compiler is a kind of an agent, who tells you what’s allowed or not in your code. With Swift that agent is very strict, he (or she?) determines how you should and shouldn’t program a number of things. Do you stick to the rules, then your software will work. Objective-C however has a much more flexible compiler, where you as a programmer have much more freedom how you can develop your software. But if your software doesn’t work, it’s much more difficult to figure out where you made your mistakes. For this reason Swift is an attractive language for novice programmers to begin with."
The App Academy decided at the end of 2015 to emphasize on Swift. Why?
"In the previous bootcamps we taught much of the lessons in Objective-C plus an introduction to Swift. Of course Swift existed since 2014, but was not yet fully developed. With the release of Swift 2 in September 2015, there is now a stable version. Before that many errors were generated in the compiler, but you didn’t know whether you or the compiler made a programming error. Swift 2 gave us a mature version and with that being able to nicely build apps for iPhone and iPad. As I mentioned earlier, it’s easy to learn the language, which we as teachers notice in the current bootcamps. The students’ learning curve is faster and it takes them less effort to understand how apps are developed."
"An additional advantage is that Swift has become open source and works under Linux, thus you can also work with Swift on a server. So basically you use the same language if you want to talk to the server from your software. For that reason I think Swift also has taken such a flight among app developers. And Linux programmers also benefit of course."
Final question, is such a young programming language interesting for experienced developers?
"I go to a lot of Swift meetups. On those occasions senior developers showcase that you can absolutely apply advanced programming techniques in Swift. Sometimes it goes so far that I need to repeat this at home to review what they have actually done! For example, you can now already work protocol orientated. These are techniques that you will not use any time soon, but it’s interesting to realise that swift is a powerful tool to work with."
We just sent you an email. Please click the link in the email to confirm your subscription!