On Cocoa

by Erica Sadun

I was surprised at how much I enjoyed myself this last week. Since Sunday, I've been programming Apple TV plug-ins. They aren't big programs to work with--more like programming haikus--but it reminds me again how much I adore Cocoa and Core Foundation and all. I spend most of my programming time these days writing scripts to scrape webpages and access web APIs.

I've also been rewriting (or to be more correct, rerererewriting) an article about developers adapting sample Cocoa code to a shipping product. I also wrote about adapting sample code here. All this has brought me to the piece I've missed talking about, which is the role Google plays in Cocoa programming. The Foundation docs at Apple tell you what's supposed to work but it's all the developers out there in searchable google-land that tell you how to get around the known bugs and errors and how the method calls really work.

Thank goodness for Google.

5 Comments

pauldwaite
2007-04-12 13:02:45
I gotta say, I seem to remember reading more than one developer writing about a successful Mac program that they've made, and at some point they say "Yeah, it took me slightly longer because I didn't know any Cocoa" or "I'd barely done any programming before so I took a little time to get up to speed."


It just seems like Cocoa isn't dumbed down, but makes it as nice as possible for programmers. Like Aaron Hillegass says in his Cocoa book:


"Most of the time, Cocoa fulfills the promise: Common things are easy and uncommon things are possible. If you find yourself writing many lines of code to do something rather ordinary, you are probably on the wrong track."
Ryan
2007-04-13 15:54:43
I second Google as a great programming resource, and not only for Cocoa. I do a lot of VB programming at work. Even in Visual Studio 2003, which has pretty good documentation of object methods (relatively speaking), there are just some times that an explanation like "accepts an identifier and returns a matching object" is no help at all on how to actually use something. I use sample code online *constantly* in my job.
Jurie
2007-04-14 01:12:37
"I spend most of my programming time these days writing scripts to scrape webpages and access web APIs."


I don't want to knock Cocoa (hey, I want to *learn* Cocoa), but that joy can be had without Cocoa too. Say, in Python, or Perl.


Slightly worried though - from your description, it sounds like Apple's documentation is weak and / or Cocoa is full of bugs? I hope this is not true, I was rather looking forward to making a real Mac app some day.


(Bah, how do I do the fancy quoting? [cite] sure isn't working :P)

Michael Burton
2007-04-16 01:33:47
Jurie said:


(Bah, how do I do the fancy quoting? [cite] sure isn't working :P)


Try <blockquote>.

Erica Sadun
2007-04-16 12:49:52
The documentation certainly is not weak but it doesn't contain real life examples much. And yes there are bugs and if you only go by the docs you might not find real-world work-arounds.