JS to Swift

For my thesis project at Hack Reactor my group elected to build a native iPhone app using Swift. I was excited to learn Swift because I felt that learning another language and developing for a different platform would be a great way to become a better software engineer. I believe that it has and here’s why:

When Swift was announced last July there was a lot of excitement over the simplicity and accessibility of this new language. People felt that the learning curve for Swift would be substantially less than that of Objective C. In fact, the name “Swift” probably has more to do with increasing developer productivity than any potential performance benefits(Speed tests in fact seem to show Objective C actually performs much faster than Swift). So just how easy is it to learn Swift?

Short answer: Very.

Coming from a strong Javascript background I was excited to learn Swift because I felt that it would make me a stronger software engineer in general. I was nervous at first that the language would be difficult but I actually found the learning process to be very satisfying. Javascript can be defined as very “loosey-goosey”. Swift though follows a more rigid design philosophy. It is more abstracted than a C based language though and so it falls somewhere between C and Javascript. After only a few days the Swift syntax became familiar and I was able to solve our morning algorithm puzzles in Swift as well as Javascript.

Here are some of the big gotchas that I came across while learning Swift:

Swift is great and easy to learn, but an important thing to note is that learning Swift and learning iOS development are two different things entirely. Learning iOS has been a beast. I have spent hours trying to accomplish seemingly simple tasks. Some tasks, like designing the layout and appearance of the App, took far less time in xCode than it would in HTML and CSS but other tasks, like making asynchronous calls to a server, took forever to figure out. Learning iOS has been very difficult, but learning Swift has been easy and fun.

 
19
Kudos
 
19
Kudos

Now read this

Simple Recursion

A significant chunk of Hack Reactor’s pre-course work involves rebuilding several javascript functions that utilize recursion. The first time I saw recursion I had a very difficult time mentally wrapping my mind around it. My brain... Continue →