If you're interested in learning Swift, Apple offers a free Swift Programming Language book. That said, Swift makes it more difficult to make dumb errors." Swift also will offer "Playgrounds," a window that displays the results of a program in real time before committing it to a project. "Learning Swift will be slightly more difficult than learning Objective-C, is a very simple language. "Swift is lovely, but there are many more rules enforced by the compiler," he said. For example, simple three-character keywords define variables (as "var") and constants (as "let").įor that reason, Hillegass says, Swift will not be as easy to learn as some of the reports would have you believe. "Variables are always initialized before use, arrays and integers are checked for overflow, and memory is managed automatically." On the whole, it's as if Apple took Objective-C and tweaked the syntax to make it more foolproof turned it into a more natural way to express the developer's intent. In the same vein, "Swift eliminates entire classes of unsafe code," according to Apple's Swift introductory web page. "Swift makes it more difficult to make dumb errors." "If you are a good Objective-C programmer, you will have no problem making the transition to Swift because even though the syntax is different, the ideas expressed in the two languages are exactly the same." There's also a new two-phase process for initializing classes, a slight change from Objective-C that helps avoid programming mistakes (aka bugs). With the help of a feature called type inference, developers face fewer complications when declaring types in the the new language. "The syntax is clean and It allows the compiler to do more work for us," said Hillegass, who once worked as a developer for NeXT. "Swift will be a great step forward for the iOS and Mac developer communities," said Aaron Hillegass, president and founder of Big Nerd Ranch, an Atlanta-based software consultancy that specializes in iOS. Registered Apple developers can download Xcode beta 6 to receive the Swift language right now. Swift code can co-exist in a project with Objective-C code, a move that clearly was meant to help spur adoption. Both statically-typed languages will be part of Apple's Xcode IDE and use the same Cocoa and Cocoa Touch APIs, and the same LLVM compiler. And after several years in development, Apple has revealed its successor to work alongside the aging veteran and transition to a more modern language that's completely under its purview. The new language reportedly will work right alongside Apple's stalwart, which is used to build the majority of apps that run natively on iOS and Mac OS X.īut Objective-C is 30 years old. By far the more impactful news for solution providers was about Apple's Swift programming language, a new development environment that it says will be faster and easier to use than Objective-C. Most of the headlines from Apple's Worldwide Developers Conference 2014 last week were about iOS 8 and OS X Yosemite (v10.10), both on tap for this fall.
0 Comments
Leave a Reply. |