Digital Media Mac Blogs > Mac

iPhone without Cocoa?


At a musical presentation on Rails at OSCON a few years back, Why performed a song in which the lyrics promised that you could do Rails without knowing any Ruby. The audience roared in laughter at that line but it keeps coming back to me as I answer questions about the iPhone and Cocoa.

There are a ton of people attracted by the iPhone gold rush who want to write iPhone apps without taking the time to learn Cocoa. Just as with Ruby and Rails, it is possible to leap over the foundational material to get to the cool iPhone stuff. In your rush to do so, you are skipping a lot of the really cool stuff and missing techniques that would really come in handy. Besides, with Apple's increased market share, there is a lot of opportunity in writing applications for the Mac itself.

I'm biased.

I'm finishing up writing a Cocoa Programming book for the Prags and I'm co-teaching a Cocoa Studio with Bill Dudney in Reston, Virginia in the beginning of February.

The Cocoa Studio doesn't seem as sexy as the iPhone Studio but we had a lot of fun teaching it in Denver this fall. We've beefed it up quite a bit for our east coast debut. I think the Cocoa material stands on its own if you want to target the Mac. But I also think that much of the material provides a solid foundation for your iPhone development.

Early bird registration discount expires soon. Come for the phone, stay for the Mac. See you there!

Categories





AddThis Social Bookmark Button
Comments (4)
Read More Entries by Daniel H. Steinberg.

4 Comments

Justin L said:

in no particular order:

I've extensively written for: borland C++, delphi, the bare windows api, bare X11, qt, gtk, flash, .NET, JS/DOM, cocoa, and others

I've extensively written in: basic, turbo and object pascal, assembler, C, C++, C#, java, javascript/actionscript, php, objective C, and many, many others

the one fairly unique thing about cocoa and obj-c, among toolkits and languages that are compiled into native code, is using runtime symbol lookups to deliver events

and that isn't an entirely horrible idea, though I personally prefer to do anything/everything I can to avoid anything so much as resembling dynamic binding

however, that being said, objective C is by far the worst language I've ever used

message syntax is horrible. it's a horrible concept that seems to be designed to help novices understand the concept of a function call by relating it to a letter, which is about as useful and practical to me as comparing plaintext to a choochoo and an encrypted channel to a tunnel.

obj-C simply means more typing (especially those f#$*@ng explicit parameter names and double-declaration of half your symbols), less readable code ([ o m: [ f g ] ]), far fewer language capabilities, and diminished performance and reliability where dynamic binding is used

switching to objective C for cocoa is like switching from a 56-inch plasma TV to a 12 inch b&w so you can watch a grainy analog broadcast that isn't terribly interesting in the first place

It's surprising how some of the best Cocoa stuff doesn't show up very prominently in the iPhone world. I found that key-value observing was a very elegant solution to a problem on our iPhone book (it'll probably appear in my file i/o chapter at some point), yet I almost never see iPhone developers talking about KVO.

We also had a question from a reader about why nobody on the iPhone uses awakeFromNib like you always see in Mac Cocoa, and aside from the fact that some alternatives can be more descriptive (e.g., UIViewController's viewDidLoad), I really didn't have a good answer.

I'm just finding it a bit challenging to have to deal with memory at a lower level again (release/free to some extent) than in a true GCed world such as Java or other similar languages. I know GCing presents overhead, etc., but it does seem like Android was able to accomplish that and felt it was a good path to choose.

Still, love my iPhone and the apps I can produce on it. Good to have competition and healthy diversity in a space.

Rod Schmidt said:

Cocoa is awesome people. Don't be afraid. It's way better and easier than Java. It's way simpler than C++. I've been developing software for almost 20 years and Cocoa is simply the best development platform there is. Period.

Embrace Cocoa and you will see the benefits.

Leave a comment


Type the characters you see in the picture above.

Recommended for You

Topics of Interest

Archives


 
 


Or, visit our complete archive.