What Does Swift Mean for Programming Education?

By @zachfeldman
Written on Jun 4, 2014

For those who may not have heard, Swift is the new programming language Apple released at their World Wide Developer Conference earlier this week to power iOS and OS X application development into the future. In the past, these applications were written natively in Objective-C. There have also been a few other ways to create an iOS application, including using a toolchain like Rubymotion that runs on the Objective-C runtime or writing C# through a toolchain like Xamarin. However, this isn’t nearly as performant as writing a native app in Objective-C.

Apple also published an iBook yesterday, “The Swift Programming Language”, which is a complete guide to the language itself. From looking at some of the syntax, we can already see that this language is going to be huge for programming education. Ruby, Sinatra, and Rails have already given programming instructors and students an easy to understand yet powerful toolchain for web application development. Having a a language and syntax where you don’t have to worry about memory management and other low-level system problems will really open up the iOS development scene to more people, turning app consumers into app producers in a similar way that Rails opened up the web application development sphere.

For instance, in the prototypical “Hello World” program that most programming guides use as the first example, we can see why Ruby and Swift are easier to understand than Objective-C:

1
2
3
4
5
6
7
8
9
#import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSLog (@"Hello, World!"); [pool drain]; return 0; }

For those not saavy in development, this program looks downright SCARY. To break things down, we start by importing the base Obj-C library, have to define a main function, allocate memory, log “Hello World”, then make sure the program has a defined return.

A similar program in Ruby looks like this:

1
puts "Hello World"

As you can see, Ruby is the great equivacator! When you don’t have to worry about memory allocation, things are a lot more fun. Almost anybody can understand the above line. But how easy is this program to write in Apple’s new developer friendly digs, the Swift language?

1
println("Hello World")

As Staples might say, “that was easy”. Incredibly easy in fact! And we saved about 7 lines of code.

Rather then having to explain memory management, file imports, and low-level systems architecture to beginner programmers, we can have them writing productive code on day one.

Here at the New York Code + Design Academy, we believe the above code represents a true paradigm shift in learning iOS and OS X programming and we’re really excited to be teaching the first iOS class using a language that should make it simple for beginners to get started! We’re hosting a free lecture on Swift on June 18th at either 6:30 or 7:30pm. To RSVP, just go to nycda.com/swift. If you’re interested in signing up for our 16-week iOS development with Swift course, you can contact us at info@nycda.com.  We’ve also started a meetup group for Swift developers in New York City that you can join to stay up to date on the latest Swift developments and lectures.

Whenever a new technology like this comes up, the community is always a bit leery to get on board, waiting to see how the industry as a whole deals with the change. We’ve decided to ride this wave head on and we’re excited to see how Swift will impact programming education. Come join us on our journey!

X-posted from the New York Code + Design Academy blog.





Sign up for our e-mail list to hear about new posts.