[英]《Swift基礎教程》作者Boisy Pitre:Objective-C很不錯,但它已經是過去時(圖靈訪談)
Boisy G. Pitre是一位資深蘋果開發專家,曾任Siri語音識別技術提供方Nuance公司Mac產品小組的資深軟體工程師,參與開發了語音識別軟體Dragon Dictate。MacTech雜誌“Developer to Developer”月度專欄作家,曾多次在MacTech和CocoaConf等會議上發表技術演講。現任情緒識別公司Affectiva的移動遠景規劃師,領導團隊致力於將公司的表情分析技術遷移到移動平臺。Boisy著有《Swift基礎教程》一書。
iTuring: What was your purpose of writing Swift for Beginners?
When Apple introduced Swift, I knew it would become an important part of the computer language landscape in the years ahead. It was my goal to bring readers a fun and easy introduction into this new language so that they could get a head start, and get up to speed quickly. It was challenging because there is so much in the language to discuss, and I didn’t want to overwhelm the reader with too much. It was written with the beginner in mind, and I think it has been well received in that regard.
iTuring: Would you please introduce to your readers about your work at Affectiva?
Certainly. Affectiva is a technology company which brings emotional intelligence to digital experiences. Their technology is based on real-time facial analysis to determine the emotional state of an individual. I am their Mobile Visionary, where my responsibility is to bridge the technology to the mobile world. We’ve achieved that and now I work to improve the technology on mobile platforms such as iOS an Android. We have an SDK that developers can use to integrate emotional intelligence into their apps.
iTuring: In your opinion, what will open source of Swift change about its ecosystem and dynamics between iOS and Android?
It is difficult to predict how Swift as an open-source language will impact Android development. Google has their own language initiative with Go, which is what Swift is to iOS. I would expect that there will be work towards writing Android apps in Swift, just as there is writing iOS apps in Go. Will one be more successful over the other? Or will the respective languages cling to their own natural platforms? Only time will tell. However, Apple’s decision to open source the Swift language certainly has changed the dynamics for the better.
iTuring: What does Swift integrate from other languages? What are the favorite features you like about Swift?
All computer languages tend to borrow from other languages. For Swift, it’s no different. I see a good deal of the Rust language in Swift from a syntax and memory model point of view. It’s apparent that Swift’s emphasis on safety keeps it at arm’s length from C and C++, so there is very little in common there. I believe Apple has tried hard to make Swift its own language on its own terms. We’ll see how that plays out.
My favorite feature of Swift by far is its clarity in syntax. Establishing a constant variable with the ‘let’ keyword vs. a mutable variable with the ‘var’ keyword simplifies the syntax quite a bit from the C/C++ way. Functions are clearly written with enforced named parameters (like Objective-C), and closures are easy to create and use.
iTuring: Is it possible that Swift will take place of Objective-C completely in the future?
Sure. How long that will take is anyone’s guess, but it could happen in 5 years or even less. It’s easy to forget that computer languages have long, long lives (C is four decades old at this point). Objective-C won’t completely go away, but I can see a time where it is relegated to a very small portion of the languages pool.
iTuring: Objective-C still constitutes much of iOS's frameworks, which are invoked by bridging header file nowadays, will there be simpler method of invocation in the future? Will there be more frameworks based on Swift from now on?
That is almost certain to happen, and I believe Apple is working hard right now to do just that. Keep in mind that it is a huge task, as there are dozens and dozens of frameworks that need to be converted. I believe this work will be completed before too long, and we’ll soon see a time where new frameworks are Swift only and do not even have an Objective-C counterpart. When this happens, it will certainly have an impact on the use of Objective-C going forward.
iTuring: What do you recommend a beginner to learn first, Objective-C or Swift?
Definitely Swift. Objective-C is a great language, but it carries the legacy (and baggage) of C. It’s also going to become less and less relevant as time goes on for writing apps. In fact, I would not even start a new iOS or OS X project in Objective-C. I would only use Swift going forward for new projects.
iTuring: For programmers who have already had a good understanding of one or two programming languages, what would you recommend them to do in order to learn a new language in an effective and efficient way?
It depends on what those one or two languages are. If those two languages are Objective-C and Swift, or C and C++, or any combination thereof, I would recommend learning an entirely different language to challenge the mind. Imperative languages like C, C++, Objective-C, and Swift tend to follow the same models, so it’s easy to learn a new language of that class. It’s important to expose yourself to different language paradigms, so I would recommend learning a functional language like Scheme. Even though it’s not a language you will write apps in, it will expand your understanding of computer languages in general.
iTuring: In the process of learning programming languages, when is the best time to engage with masses of libraries and APIs? Is it necessary for a programmer to know every API he/she might use?
I often use the analogy of the carpenter with a tool belt. Does he have every conceivable tool in his belt? No… only the ones he uses most often. When he has to get a specialized tool, he will walk to his truck, open the large toolbox there, and use that tool once or twice, then put it up. It’s the same with programming languages and APIs. It is impossible to know every API completely, but the more you know, the better you can solve a problem. I would suggest learning the language to a great degree at first, and then continue to study the nuances of the language while introducing yourself to the frameworks and APIs that you can use to create useful apps in that language. Then, once a week, pick a new API and commit 3-5 hours of study to learn about what it does. You may not use that API very much, but you will know it exists, and when the time comes, you can be prepared to recommend it to solve a particular task.
iTuring: For an expert of iOS development, what does his/her knowledge framework looks like?
A well rounded iOS expert has a mastery of four things:
- (1) the language used to write apps (Swift / Objective-C),
- (2) a command of the tools to create the software (Xcode),
- (3) strong knowledge of the basic frameworks and APIs that go into writing iOS apps, and
- (4) an eye for good UI design.
It takes many apps and hundreds of hours of programming to approach this level. Each app brings its own requirements and APIs that it needs, so the more apps you write, the more exposure you get to the breadth of Apple’s frameworks and the better your UI design skills become.
更多精彩,加入圖靈訪談微信!
相關文章
- 《Swift基礎教程》作者Boisy Pitre:Objective-C很不錯,但它已經是過去時(圖靈訪談)SwiftObject圖靈
- 《Swift基礎教程》作者Boisy Pitre訪談問題有獎徵集(圖靈訪談)Swift圖靈
- 《SQL基礎教程(第2版)》作者MICK(ミック)訪談話題有獎徵集(圖靈訪談)SQL圖靈
- 《SQL基礎教程(第2版)》作者MICK:上帝存在於細節之中(圖靈訪談)SQL圖靈
- [英]專訪《寫給大家看的設計書》作者Robin Williams(圖靈訪談)圖靈
- [英]《奇思妙想》作者Dennis Shasha:小品電腦科學(圖靈訪談)圖靈
- [英]“龍書”作者Jeffery Ullman:相信你自己,自由地思考(圖靈訪談)圖靈
- [英]《Swift與Cocoa框架開發》作者Paris Buttfield-Addison:你的程式設計生涯可以從Swift開始!(圖靈訪談)Swift框架程式設計圖靈
- 《機器學習》作者Peter Flach訪談問題有獎徵集(圖靈訪談)機器學習圖靈
- [英]《JavaScript快速全棧開發》作者Azat Mardanov:現在是擁抱Node技術棧的最佳時機(圖靈訪談)JavaScript全棧圖靈
- [英]《禽獸心理學》作者Anna Salter:防止兒童性侵害,從你我做起(圖靈訪談)圖靈
- 《演算法圖解》作者Adit Bhargava訪談問題徵集(圖靈訪談)演算法圖解圖靈
- 《特斯拉》作者卡爾森教授訪談問題有獎徵集(圖靈訪談)圖靈
- 《釋出!》作者Michael Nygard訪談問題有獎徵集(圖靈訪談)圖靈
- [英]《HTTP權威指南》作者Anshu Aggarwal:用計算機來節能(圖靈訪談)HTTP計算機圖靈
- 《AngularJS權威教程》作者Ari Lerner有獎問題徵集(圖靈訪談)AngularJS圖靈
- 《圖靈的祕密》作者Charles Petzold:我眼中的圖靈機和Windows(圖靈訪談)圖靈Windows
- 《CSS揭祕》作者Lea Verou訪談問題有獎徵集(圖靈訪談)CSS圖靈
- 《鳳凰專案》作者基恩·金訪談問題有獎徵集(圖靈訪談)圖靈
- [英]《釋出!》作者Michael Nygard:質疑軟體開發最基本的假設(圖靈訪談)圖靈
- [英]《資料科學實戰》作者Cathy O'Neil:大資料並不神奇(圖靈訪談)資料科學大資料圖靈
- 圖靈訪談圖靈
- 有獎 |《人工智慧簡史》作者尼克訪談話題徵集(圖靈訪談)人工智慧圖靈
- 《JavaScript Web應用開發》作者Nicolas Bevacqua訪談問題徵集(圖靈訪談)JavaScriptWeb圖靈
- 《AngularJS 2 權威指南》作者Nate Murray訪談問題徵集(圖靈訪談)AngularJS圖靈
- 《跟阿銘學Linux》作者阿銘訪談話題有獎徵集(圖靈訪談)Linux圖靈
- 《禽獸心理學》作者Anna Salter訪談問題有獎徵集(圖靈訪談)圖靈
- 《圖靈的祕密》作者Charles Petzold訪談問題徵集圖靈
- [英]《Python Web開發》作者Harry Percival:TDD就是微小而漸進的改變(圖靈訪談)PythonWeb圖靈
- [英]《Linux/Unix設計思想》作者Mike Gancerz:Linux/Unix哲學的印證(圖靈訪談)Linux圖靈
- 《R包開發》作者Hadley Wickham訪談問題有獎徵集(圖靈訪談)圖靈
- 《用資料講故事》作者Cole Knaflic訪談話題有獎徵集(圖靈訪談)圖靈
- 《使用者思維+》作者Kathy Sierra訪談問題有獎徵集(圖靈訪談)圖靈
- 《Flask Web開發》作者Miguel Grinberg訪談問題有獎徵集(圖靈訪談)FlaskWeb圖靈
- Jolt大獎獲獎作者Venkat Subramaniam訪談問題有獎徵集(圖靈訪談)圖靈
- 譯後訪談《Scratch少兒趣味程式設計》作者阿部和廣(圖靈訪談)程式設計圖靈
- [英] 《七週七併發模型》作者Paul Butcher:用併發計算實現最大效率(圖靈訪談)模型圖靈
- 《演算法的樂趣》作者王曉華:“玩”過就是收穫(圖靈訪談)演算法圖靈