Flash to the iPhone: The Right Way

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.

With Adobe CS5, you can automagically convert your Flash files into an iPhone app. Problem solved, right? You can also use Javascript/HTML5 (Appcelerator), Unity3D, or learn a new scripting language with Corona.

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

Learn Objective-C.

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.

Resources

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.

Le Fin

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.

[Post to Twitter] Tweet This Post 

7 Comments

  1. Brian Kadar
    Posted April 11, 2010 at 11:50 pm | #

    Quality control. From Steve Jobs himself:

    We’ve been there before, and intermediate layers between the platform and the developer ultimately produces sub-standard apps and hinders the progress of the platform.

  2. Shea Gonyo
    Posted April 11, 2010 at 11:48 pm | #

    It looks like Apple shares your sentiment and decided to pull the plug on these crAppcelerators. Nice post.

  3. Brian Kadar
    Posted April 8, 2010 at 6:11 pm | #

    Android may be on more phones, but which consumers are buying more apps? http://arstechnica.com/apple/news/2010/01/apple-responsible-for-994-of-mobile-app-sales-in-2009.ars

  4. Posted April 8, 2010 at 5:55 pm | #

    Apple have a great mobile OS - but the fact is, it’ll never be as widely adopted as Android in the long-term, least of all because Android is available on more than one brand of hardware.

    Isn’t this similar to the Apple OS X vs Windows debate? Regardless of which we think is better, Windows always wins in terms of numbers and reach.

    Of course, that’s not to say building Apple Apps can’t be profitable - but I think there is a lost opportunity if developers focus solely on one platform.

  5. brian
    Posted April 8, 2010 at 5:13 pm | #

    Good question, Martin. Apple’s mobile market share is nothing to laugh at; we’re past the 95% of people use Windows when it comes to the mobile space. They offer the best hardware and distribution bar none (including an avid user base).

  6. Posted April 8, 2010 at 4:05 pm | #

    Have you looked into developing for the Android platform? I wonder whether that has more potential in the long term in terms of consumer adoption/reach?

  7. Posted April 5, 2010 at 8:36 pm | #

    Nice Article, Mr.Kadar. I am sure you are heading the “right way” Hopefully i will see your apps soon. Buy me a iPad 4G when you are a millionaire, will you? :)

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>