What it is: Every operating system tends to have a favored programming language. For apple products, that favored programming language is Swift.
If you want maximum control over a particular operating system, you should learn the favored programming language for that particular operating system. That will give you the greatest job opportunities along with being able to share the most amount of code with others. In Windows, the favored programming language is C#, which means you can safely ignore other programming languages like Visual Basic.NET unless you want to learn a secondary language. In Linux, the favored programming language is C++. In OS X, iOS, and watchOS, the favored programming language used to be Objective-C but now it’s Swift.
Objective-C isn’t going anywhere since the foundation of IOS X, iOS, and watchOS are based on Objective-C. However, unless you’re already a skilled Objective-C programmer, you’re far better off learning and using Swift. That’s because Apple has made Swift their new official language and Swift is far easier to learn and use than Objective-C while also being safer as well. Given all these advantages and the shrinking number of disadvantages, it’s easy to see that Swift is the future of Apple programming.
That doesn’t mean you shouldn’t learn other programming languages. It just means if you want the latest features and the maximum amount of control over Apple products, you must learn Swift. Unfortunately learning Swift can be a bit troublesome, but not so nearly as frustrating as learning Objective-C. To learn Swift, you actually have to tackle several topics at once:
- Learning the basics of programming
- Learning the syntax of Swift
- Learning the basics of Xcode
- Learning how to create OS X, iOS, and watchOS specific programs
To learn the basics of programming, you can start with any language such as BASIC or Python. The easier the programming language, the easier it will be to understand the basics of programming in general. Some people prefer learning programming using the programming language they ultimately want to learn, but that can also cause frustration because to learn C, you have to get used to the cryptic syntax of C. That alone can pose an insurmountable barrier to many people and stop them from learning programming altogether.
The drawback k of learning a simpler programming language is that once you understand the principles of programming, you have to relearn new ways of doing things in another programming language. This could prove frustrating and time-consuming.
Learning Swift is actually pretty simple because Xcode comes with an interpreter called Playground that lets you type in Swift code and see how it works. By using playgrounds, you can freely experiment with learning Swift without getting bogged down in creating actual OS X, iOS, or watchOS apps.
Xcode is the main editor and compiler for Swift, so you might as well learn how to use Xcode since that’s the programming tool Apple, Microsoft, Adobe, and many others use to create software for Apple products. Learning Xcode can be a chore in itself so take your time and learn just enough to use it without getting overwhelmed by all of its features.
Finally, each operating system (OS X, iOS, and watchOS) have their individual quirks, so you’ll need to learn how to program each operating system to create apps. For example, learning OS X programming means using the Cocoa framework, which is different from the Cocoa Touch framework used in iOS. Both frameworks are similar, but slightly difference since iOS apps need to worry about the screen flipping or rotating while OS X programs do not.
For that reason, it’s often easier to learn Swift, Xcode, and programming in general by starting with OS X programming instead of iOS or watchOS. While everyone wants to create an app, iOS programming is more confusing than OS X programming since you have to worry about different screen sizes and touch gestures that you can completely ignore in OS X. So if you’re going to learn Swift, it’s often easier to start with OS X programming. Only after you get comfortable with OS X programming, using Xcode, and using Swift, can you then make the next step to learning iOS programming.
However if you try to learn iOS programming right from the start, you risk getting confused and frustrating by having to learn so much simultaneously. The less barriers you throw in front of yourself initially, the faster you’ll be able to learn. The drawback is that you’ll need to take more time to learn but if taking more time increases the chances that you’ll actually learn, it will be time well spent.
That’s why I wrote a Swift programming book for OS X. Partly because other authors had already written books on Swift programming for iOS, but also partly because learning Swift is much easier on OS X than on iOS. If you want to become an iOS programmer, you can jump right in and plow ahead, or you can take the gentler, more time-consuming route and learning Swift programming for OS X first. It doesn’t matter which route you pick just as long as you learn what you want since there are pros and cons to each approach.
Regardless of the route you choose, if you’re serious about learning programming for Apple products, learn Swift. It will be the most popular programming language for all Apple products from now on and it will only get more powerful than Objective-C over time. Make Swift your primary language for Apple products and if you have time, learn other programming languages for fun. Just make sure you have a solid foundation in Swift first.