Monday, March 16, 2009

iPhone SDK Presentation at CJUG 2/17/09

Our local Java User's Group chapter, CJUG recently hosted a presentation by Rakesh Vidyadharan titled iPhone SDK: Java Developers Perspective (link to PDF). It wasn't so much an immersion in iPhone development per se, but an introduction to development in Objective C.

Some of the things I found interesting:

  • The SDK requires an Intel-based Mac
  • The MVC approach is pretty much baked into the framework. Not everyone likes that.
  • Development with an emulator is a breeze, but pushing an app to a real iPhone is time consuming
  • Getting apps considered for inclusion in the app store is well-documented, but a convoluted process
Some things about Objective C:
  • Very similar to TCL scripting
  • Weak typing and dynamically-bound variables like javascript, ruby and php
  • There's no namespaces or packages, which means every class has to have a complete unique name. To group variables, developers adopt precursors, like CUreader, CUwriter, CUcreator, etc. And the language has several precursors reserved for the language core. For example, you can't define any classes or variables beginning with NS, IB, or UI.
  • Parameter names are part of the signature of a method. For example, foo(first_name: "Greg", last_name: "Sandell")
  • The code is visibly very different from Java, or even C and C++. Many lines start with a plus or minus sign.
Object-Oriented characteristics of Objective C:
  • Much less a "real" Objected Oriented language than C++
  • Objects don't automatically inherit a base Object as in java. You have to explicitly extend NSObject
  • Objects automatically have setters and getters, like ruby
  • Like C, you completely manage your own memory. OsX since Tiger has a garbage collector, but Objective C doesn't use it
  • Memory is managed by a incremental counting approach called refcount. Each alloc increments refcount, each release decrements it
  • Dealloc is like finalize in java
  • Messaging is a big part of the language. For example, methods are invoked via messages.

No comments: