After spending the first 5 years of my career making Flash websites, this past week I jumped in the deep-end and started learning how to develop for the iPhone OS. In case you’re wondering, this post has nothing to do with whether Flash is dead or not (for that answer, go here.) On the other hand, there is no question that the iPhone and iPad are very, very much alive and kicking. For Flash developers who are used to rich, immersive experiences (and often criticized for it), moving onto the iPhone OS is a natural leap.
Crossing over into a new, unfamiliar language like Objective-C can be intimidating. But what I’m quickly realizing is how easily one can apply concepts from ActionScript to understanding Objective-C (I will be writing about this more extensively in upcoming posts.) Noticing the strengths and weaknesses, similarities, and differences of these (or any) languages will make you a better programmer overall.
But not everyone feels the same.
The Wrong Way
There are a lot of ways you can make iPhone apps without ever learning how to make an iPhone App.
Sounds enticing. My advice to you: AVOID THESE AT ALL COSTS.
Let’s pretend you’re moving to Paris. Instead of learning French, you hire a translator to travel with you. You’ll get around, but you’ll always experience things second-hand.
Imagine how much more (and better, and faster) you can accomplish if you actually understand the language, instead of relying on an interpreter? You’ll discover different dialects, and learn the nuances of language that can create meaningful conversation with the locals. And who’s to say that nothing gets lost in translation? You give up control.
This isn’t just a philosophical argument; there are plenty of technical issues as well. Certain paradigms of language cannot always be directly translated to another. Take memory management—that’s somewhat of an afterthought (mystery, really) in ActionScript, while in Objective-C it is a core, underlying principle with explicit methodologies.
Using these utilities immediately puts you at a technical disadvantage. You’re unable to leverage the nuances of the language that are crucial for performance and problem solving. Early users of Adobe CS5’s iPhone Builder are warning of poor optimization/performance, the lack of supporting libraries, and inability to implement features like in-app purchase support—and this is just the tip of the iceberg. Buy a second-hand TV and chances are you’ll be missing the remote and manual.
One misguided selling point says that you can “…quickly develop… without having to learn Objective-C, Cocoa, and the intricacies of the iPhone SDK.”
Knowing the “intricacies” of something is what makes you an expert; it gives you fluency in a language—whether romantic or programming. Otherwise, you’re wasting your time (and in most cases, your money). These 4th-party SDKs and conversion utilities are the path of least resistance, workarounds, and nothing more than a brick wall between you and understanding the iPhone OS.
Nevertheless, a lot of developers are willing to compensate for these inadequacies in exchange for faster development: “Deploying to the iPhone is the easy part. The hard part is getting your content to run silky smooth and in an iPhone-friendly way.” I rest my case.
One Adobe presentation on this topic leads with a quote by Mies van der Rohe: “Less is More.” In this context It seems less of a creative philosophy and more of an attempt to mask limitations.
The Right Way
Keith Peter says it best in his post on the same issue:
I still believe the bottom line is, if you are serious about developing for the iPhone, you must learn Objective-C. For God’s sake, it’s NOT THAT HARD! Be a professional. Learn a new language. If you are even moderately skilled with AS3, you will be able to pick up Objective-C inside a week
A lot of critics say that ActionScript isn’t a real language (and early on, they were right). But as ActionScript has grown up over time, it has adopted concepts global to more formal OOP languages, allowing Flash developers to embrace patterns like MVC, Encapsulation, Polymorphism, and Inheritance—in that sense both ActionScript 3.0 and Objective-C (and many others) speak the same language. If you understand the terms in the last sentence, then you are well on your way to mastering Objective-C.
Apple is seemingly going out of its way to provide tons of resources for learning Objective-C—after all, in the end it’s money for them too. You can even watch an entire semester’s worth of lectures (and practice assignments) from a Stanford University iPhone development course. For free. Taught by Apple Developer’s themselves. For free.
Concepts are the key to mastering any programming language. Bridging the mental gaps between different languages reveals insights that make you a better programmer in any language.
Update from April 29, 2010
In a writing for Business Insider, Steve Jobs explains the reasoning behind not including Flash on their mobile devices, and has this to say regarding their third-party tool:
We know from painful experience that letting a third party layer of software come between the platform and the developer ultimately results in sub-standard apps and hinders the enhancement and progress of the platform. If developers grow dependent on third party development libraries and tools, they can only take advantage of platform enhancements if and when the third party chooses to adopt the new features. We cannot be at the mercy of a third party deciding if and when they will make our enhancements available to our developers.
This becomes even worse if the third party is supplying a cross platform development tool. The third party may not adopt enhancements from one platform unless they are available on all of their supported platforms. Hence developers only have access to the lowest common denominator set of features. Again, we cannot accept an outcome where developers are blocked from using our innovations and enhancements because they are not available on our competitor’s platforms.