Cappuccino: Objective-J

Cappuccino è un progetto interessante, anche se molto particolare.

Cappuccino is an open source framework that makes it easy to build
desktop-caliber applications that run in a web browser.
Cappuccino is built on top of standard web technologies like JavaScript, and
it implements most of the familiar APIs from GNUstep and Apple’s Cocoa
frameworks.

With Cappuccino, you don’t need to know HTML. You’ll never write a line of CSS. You don’t ever have interact with DOM. We only ask developers to learn one technology, Objective-J, and one set of APIs. Plus, these technologies are implementations of well known and well understood existing ones. Developers can leverage decades of collective experience to really accelerate the pace of building rich web applications.

 Tra i bonus di Cappuccino c’è la possibilità di programmarlo come se si stesse programmando in Objective-C ed in particolare in Cocoa. Può rappresentare un ottimo investimento se avete un background in XCode. L’interfaccia e le librerie constano in circa 10MB di codice compresso: non esattamente una passeggiata.

Una delle applicazioni più complicate è http://280slides.com/ che però a tempi di caricamento abbastanza alti.

L’idea è accativante, se non soffrisse dei soliti problemi di Javascript. Difatti leggiamo nel getting started (evidenziato da noi):

For those developers used to languages like Java, C++, or Objective-C, where the compiler is readily available to show you syntax and type errors, changing to Objective-J and JavaScript can be confusing at first. You will not be able to rely on a compiler to find these kinds of problems for you. Most of them will be found by the browser when you first load your application, and you’ll find those errors buried in the JavaScript console of your respective browser. It’s in the Debug menu in Safari, and in the Tools menu of Firefox (if you have Firebug installed, errors will appear in Firebug instead).

It’s important to run your code often to make sure it still works. You don’t want to end up with 300 new lines of code and no clue where the error has occurred. This is somewhat exacerbated by the fact that Objective-J has difficulty reporting the actual line number of errors. So remember to run your code often, and make use of the error console and the other tools you have available when you encounter trouble.

Quindi i punti deboli di Cappuccino sono che è una specie di meta linguaggio sopra Javascript, e che non dispone di un sistema di rilevamento degli errori.

In particolare un errore di sintassi non viene correttamente rilevato né da FireFox né da InternetExplorer.

Per forturna c’è un minimo di orientamento allo unit testing

http://www.nice-panorama.com/Programmation/cappuccino/Tutorial-objj-and-ojunit.html

Conclusioni e Riferimenti

Cappuccino è un progetto molto interessante, che mostra quante cose si possono fare in Javascript. Le interfacce ricordano come look and feel MacOSX molto da vicino, per cui se avete questo target, può valere la pena valutarlo.

Purtroppo la libreria è “brand new” e non riusa una virgola del Know-how di html/css per una scelta precisa di design. Inoltre non ricorda nessuna tecnologia Web, per cui ha senso solo se siete degli amanti di Cocoa/Objective-C

http://www.springenwerk.com/2009/09/real-life-cappuccino-tutorial-part-1.html

http://en.wikipedia.org/wiki/Objective-J