The Blog

Jan 4, 2007

Come for the Java. Stay for the Cocoa. 

by Maxim Porges @ 12:51 AM | Link | Feedback (3)

Some of you may remember this ad campaign that Apple ran a few years back as they were ramping up OS X.



See, I wasn't lying. Anyway, I originally came to the Mac for the audio editing/production, and stayed because OS X kicks ass. As far as coding goes, I did my fair share of web development and Java programming on the Mac for work related and personal stuff, but never really got in to OS X development.

Around June of 2006, I optimistically bought a book on Cocoa/Objective-C/XCode programming. I say "optimistically" since I rarely have time to do anything outside of work, other than stuff that relates to work that I didn't get to do during the work day. However, since I'm on vacation for two weeks (at home, doing nothing) I picked up the book and started to learn Objective-C and Cocoa.

I'm pretty excited about learning this stuff. I've always loved Java for the rich and varied APIs produced by the massive community behind it, but Cocoa is special in the sense that you have access to all the CoreXXX APIs that Apple creates. These APIs are the stuff of magic: video editing, image manipulation, audio programming, etc.

Not to mention Objective-C itself. While it's a bit of a strange beast, it's a very interesting mix between a compiled and dynamically typed language. You basically get to pick and choose when you want to be one or the other, which to me seems pretty flexible and puts a lot of power in the hands of the developer. So far, I learned the Objective-C basics in about an hour, and I've been doing basic coding to get me warmed up. I'm pretty excited about getting in to some of the other capabilities of the language that aren't in other OO languages like Java, such as the Protocols and the intricacies of the messaging system.

I've decided that my first app will be a Safari rip-off using WebKit, called iJustLearnedCocoa. I figured I'd start here so I can get some experience with the Cocoa frameworks and see just how easy/powerful they are for myself. After that's done, I think I'll get more adventurous and see if I can create a chroma-keying application for replacing a background color of a photo with another image. We had to consider doing something like this for a work project once, and it seemed nearly impossible with our technology platform. I'd like to see how easy it is to do with Cocoa, although I certainly have no interest in promoting this app in our workplace for reasons I won't go in to here.

Finally, the new developments for Mac development forthcoming in Leopard look simply awesome. Since I've been spoiled by Eclipse 3.2 for Java, XCode seems like a serious step backwards in terms of productivity, but from what I can see of the new tooling Apple is ramping up, a lot of this may be a non-issue when XCode 3 is released. I'm also especially pleased to see that Objective-C 2 will support language features more familiar to a Java programmer like myself, such as garbage collection.

Depending on how things go, I can honestly say that I'd love to be a Mac ISV one day. There is such a cool community behind OS X, and enough interest in small, targeted $5 - $99 software applications that it's feasible one could make a living off of such an exercise. Worst case, I'll have plenty of fun amusing myself, and should learn a new thing or two about software development that I can apply to my day job while I'm at it.

Interested in taking the plunge with me? I found this set of articles from Apple to be very useful. Their technical documentation is typicaly well-written and of excellent quality, and these documents are no exception.