Why did I add Cocoa and Rails?

Astute readers may have noticed that the title of this blog changed this past month from “Eclipse/Java Programming on Mac OS X” to “Cocoa, Eclipse, and Rails Programming on Mac OS X”. Good thing I didn’t put in Panther in there, or else I’d have to change it pretty soon to Tiger. But I did drop “Java”. And I added “Cocoa” and “Rails”. What’s going on?

Well, its a combination of filtering my feeds, inspiration from Duncan, and other passions of mine coming up to the surface.

First, the filtering…

well my feed is syndicated, the main one being planet eclipse. But I don’t want to put all my posts on there, just the Eclipse ones. So the unfortunate side-effect is that it tends to dampen your writing to just include posts on the topic of the syndicating portal. So I coded up a nice Ruby program, making extensive use of REXML, which takes my RSS feed and creates a new one that only contains the category Eclipse. So this freed me up to write about whatever I want, like tips for giving blood, (which amazingly I am currently the #1 result on Google for that search term).

Second, Duncan wrote a great post called It’s a Multi Language World. I was thinking about this and realized that it is not just a multi language world, but it is also a multi framework world. Specifically, it is A Multi Application Framework World. And I think each app framework implies a language: building on Eclipse means Java, Cocoa means Objective-C, and Rails means Ruby. So the language is subservient to the app framework and is more important. No doubt you need to master the language as well, but I don’t think it is sufficient anymore. Why? Because an application framework frees you from reinventing the wheel which is what you do when you write your own.

This enables you to focus on your true goal: to develop kick-ass software for your users. Well that is my goal. I hope it is yours as well.

Third, I’ve been quite passionate about Eclipse for a while now. I think it is the answer to the question: “How do I build great cross-platform desktop apps?” Especially for the enterprise. So to me, Eclipse is not just about the IDE. That is a great feature of Eclipse, but the main thing is the RCP, which has in the past year or so come to the forefront and is rapidly maturing.

But I’ve come to realize that Eclipse is not a silver bullet for building all apps. Specifically, I love Mac OS X. The user experience is the best. The iPod is kind of a hardware manifestation of the elegance of OS X for those who haven’t experienced it. And as much as I’d like RCP to become the way to develop top-notch OS X apps, I doubt it will. I mean, Cocoa-Java doesn’t even support all the OS X APIs.

No, the way to develop top-notch OS X apps is via Cocoa. The great thing that not too many people realize is that Cocoa is very mature. It didn’t just spring up in 2000. It’s built on NeXTSTEP, which NeXT created back in 1988, and has been refined over the years. I’ve been spending a lot of late nights programming in Cocoa, reading and re-reading Cocoa Programming for Mac OS X (Second Edition), as well as reading every other tidbit about Cocoa I can get my hands on. Soon I’ll be soaking in it at WWDC 2005.

Also, there are times when apps just make more sense to be delivered via the web. I’ve had a long history with web applications, having been fortunate to have started doing full-time programming work around the time when the web was starting to go commercial. I’ve tried a lot of webapp frameworks. There was basic CGI with C++. There were Java applets (which were amazingly cool back in the day). The ahead-of-its-time VisualWave (which was basically a Smalltalk Application Server.) Then Java Servlets. Recently there has been an explosion of webapp frameworks in the Java community, like Portlets, Struts, JSF, Spring, Tapestry, etc. These are all good things.

Then I went to Ruby for Java Programmers by Dave Thomas at No Fluff Just Stuff. He showed off this thing called Rails that seemed so remarkably easy, that I just completely wrote it off. I mean, I wrote a blog entry about the session and didn’t mention Rails once. The things Dave talked about just didn’t seem possible.

But I am a very curious fellow. And I started to wonder… what was this thing that Dave mentioned? So I watched the Rails 10 Minutes Setup Video. Then I read the tutorials and started to play around with it. Later I signed up for TextDrive, which is the official host of Rails and a great place to host Rails apps.

BTW, I was thinking about if there was some sort of unifying theme that brought these three frameworks together. The ironic thing is that you have to go back to the language level. Objective-C, Java, and Ruby are all derived from Smalltalk. Additionally, all three frameworks are free, with two (Eclipse and Rails) being open source. And of course, they all run great on OS X, with tools that are tuned for each: Xcode for Cocoa, Eclipse for itself, and TextMate for Rails.