Channels ▼

Nick Plante

Dr. Dobb's Bloggers

Objective-J and Cappuccinno

September 15, 2008

There have certainly been some interesting developments in the JavaScript web  development sphere lately. Awhile back I wrote about the SproutCore JavaScript MVC framework, which has been embraced by Apple for development of its MobileMe platform. And last week, 280North finally (officially) released their Objective-J library and the Cappuccinno framework, which gives web application developers yet another option when it comes to delivering JavaScript-heavy Internet applications.

The interesting thing about this new pair of technologies is that, unlike SproutCore, it abstracts away the process of dealing with individual bits of JavaScript, HTML, and CSS to manipulate the DOM. In short, Objective-J is built entirely in JavaScript and intended to sort of mimic Objective-C, allowing developers familiar with that language to work with tools they're already familiar with when building interactive web applications. It also adds some useful new mechanisms such as a Ruby-like methodMissing capability.

Of course, Objective-J is really just a layer on top of JavaScript, so don't worry -- any JavaScript you choose to write will work as well. For more information about Objective-J, there's a tutorial available.

Cappuccino is even more interesting. It is -- I kid you not -- a straight port of Apple's Cocoa framework (Foundation and AppKit) to the web. That means that if you're already familiar with these APIs, you can jump into Cappuccino development almost immediately. That's right, you don't need to write a line of HTML, or CSS, or ever manipulate the DOM by hand; developers merely have to learn one new "programming language" (Objective-J), which looks smells and feels exactly like Objective-C for most purposes, and then use Cappuccino to leverage the APIs that they're already familiar with as Cocoa developers to build compelling web applications. Simply create and position UI elements just like you would in Cocoa, and Cappuccino takes care of rendering out the appropriate HTML, CSS, and cross-browser-friendly JavaScript that will be interpreted by the browser. It almost sounds too good to be true and will certainly be a huge boon to any Apple developers looking to move simple desktop applications to the web.

SproutCore's framework, which we talked about previously, also aims to make developing "rich Internet applications" easier by providing a JavaScript MVC framework. But the difference is that it still relies on developers knowing and understanding HTML, CSS, and JavaScript, as well as a new set of conventions. For many of us who are already building web applications, this certainly isn't a hurlde; these are tools we're already intimately familiar with (for better or for worse!). For those of you like myself who find yourself in this position and are *not* desktop application developers, SproutCore's approach certainly seems like a better match as it simply builds on top of skills that we already possess.

On the other hand, if you're already familiar with Cocoa but lacking web skills, well Objective-J and Cappuccino certainly seems insanely compelling. 280North's flagship application (280 Slides) already developed with this set of tools is extremely fluid and attractive. Also, their scrapbook tutorial and sample application make for a great read; a lot of thought has clearly been put into this and it shows.

If you're an Objective C developer I'd definitely encourage you to take a look. If you're already comfortable with jQuery, HTML, and CSS, it may be somewhat more difficult to make the argument to switch, but taking a good read through their tutorials may still be worthwhile. I certainly can't argue with the fact that the number of technologies that we have to be familiar with as web developers is probably much greater than it should be, and it would indeed be nice to embrace a single toolset rather than 3 or 4 inter-related ones. Now if the syntax just looked a little more like Ruby, and a little less like Objective-ive-C...




Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.