An Afternoon With Cappuccino 5

Posted by Justin Reagor Sat, 28 Mar 2009 19:16:00 GMT

Ok, so I know all about the Cocoa inspired, Javascript framework, SproutCore (with it's tiny bit of Ruby for the "build process"). It definitely has the leverage of being based on current web technologies. As well as used by Apple for the "highly successful" MobileMe service (hehe). While making excellent use of the fat client pattern.

However, I just tried out Cappuccino, by way of Objective-J, and ran through some tutorials. The power of the GNUstep/Cocoa frameworks are definitely something to be seen within your web browser.

I am starting to think I prefer this more for utilizing desktop applications on the web. In a similar vein as Java applets or Flash web apps. Because that's what Cappuccino and SproutCore were built for, desktop-like web applications. Not traditional "web sites" or hyper text documentation.

Short Intro

Objective-J is the language written using Javascript. Where Cappuccino is the framework built with Obj-J. A rewrite of Cocoa and GNUstep for the DOM.

The wiki defines Objective-J as...

... a programming language developed as part of the Cappuccino web development framework. Its syntax is nearly identical to the Objective-C syntax and it shares with JavaScript the same relationship that Objective-C has with the C programing language: that of being a strict, but small, superset; adding traditional inheritance and Smalltalk/Objective-C style dynamic dispatch to JavaScript. Pure JavaScript, being a prototype-based language, already has a notion of object orientation and inheritance, but Objective-J adds the use of class-based programming to JavaScript.

Taking a small look at some of the code you will see its heavy Obj-C syntax...

@import <Foundation/CPObject.j>   

@implementation AppController : CPObject {   
  CPTextField label;   
  CPString contentString;   
};   

- (void)applicationDidFinishLaunching:(CPNotification)aNotification {   
  var contentString = @"Hello world!";   
  var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],   
  contentView = [theWindow contentView];   

  label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()];   

  [label setStringValue:contentString];   
  [label setFont:[CPFont boldSystemFontOfSize:24.0]];   
  [label sizeToFit];
  [label setAutoresizingMask:CPViewMinXMargin |
                                                   CPViewMaxXMargin |
                                                   CPViewMinYMargin |
                                                   CPViewMaxYMargin ];
  [label setFrameOrigin:CGPointMake((CGRectGetWidth([contentView bounds]) - CGRectGetWidth([label frame])) / 2.0,
                                (CGRectGetHeight([contentView bounds]) - CGRectGetHeight([label frame])) / 2.0)];

  [contentView addSubview:label];
}
@end;

The Pros

No one is suggesting you to ditch your life as a strict web standards developer and embrace the auto-generated presentation layers that Cappuccino provides. Instead, embrace the tool (TWSS). Use it when its the most appropriate.

Here are the positive bits I can identify at first glance...

  • Utilizes a proven platform and framework for desktop applications, Cocoa and GNUstep
  • Automagic cross browser support; from everything being abstracted away from you.
  • Obj-J can have Javascript intermingled, so you can write in a style with a cross between the two (hence the J).
  • NO PLUGINS; They wrote the damn lexer/parser entirely in Javascript. That's not JS ignorance, that's talent.
  • It seems pretty snappy and fast.
  • Used in production, considering 280slides.com is a killer web app.
  • Obj-J command-line interpreter
  • Theme support coming
  • Rake now employed for the "build"

The Cons

I've read through a ton of grips, mostly the introduction on Ajaxian. It seems that people at first believed this was an insult to Javascript. That there wasn't much of a purpose in bringing Obj-C to the web since HTML/CSS/JS work just as well. Of course the same people say the same thing about Java and Flash... but anyway, here are a few I'm watching out for.

  • Layers of abstraction are a plus, and a minus. :<
  • Seems you can only leverage current web tech (HTML/CSS/Canvas) through Cappuccino/Cocoa objects.
  • I haven't experienced their inheritance model yet, so I'm hoping thats not a hinderness (as in creating your own NSTableView or whatever).
  • The HTML source is completely obfuscated, and I imagine you can't make use of the DOM (restricted to Obj-J classes)
  • No command console [IRB]? Haven't found one yet.
  • Some error messages are vague.
  • Test/Behavior driven development? OJUnit does exist, haven't checked it out though.

EOF

The fact that the W3C and the industry are going to take decades to complete HTML5 and full CSS3 compliant browsers demonstrates the viability of this framework. No plugins, no compilation, just run the damn apps is POWERFUL. Also, given the success of Apple's platforms so far, Obj-C is proving itself on the desktop and on the iPhone. It's definitely not the horror that is VB.

Given those I think all-in-all it's a wonderful technology and I look forward to building a few apps with it!

ssh on iPod 5

Posted by Colin A. Bartlett Thu, 25 Oct 2007 14:38:00 GMT

I started to get the iPhone / iPod Touch itch today when I saw iStumbler pop this up on Growl:

Justin was (slacking off and) hacking his iPod touch and so it suddenly appeared on the network. Awesome!

Now, if only I didn’t have to switch to AT&T to get an iPhone.

Blogging RailsConf 2

Posted by Colin A. Bartlett Wed, 16 May 2007 20:32:00 GMT

Let the RailsConf blog begin!

Although I haven’t yet made it out of the airport in Philadelphia, and I’m not sure I ever will with the storm clouds looming over south Philly, I wanted to get the blogging started.

First observation:

There are a lot of people that have MacBook’s around me. Either there are a bunch of other people hopping flights out to RailsConf right now (seems unlikely) or Apple has really gained marketshare (quite possible).

I see several businessy looking people, an older gentleman, and more than a handful of hipster designer-looking types.

Is Apple gaining more ground than I realized? Or is this just another case of that phenomenon where once you are exposed to something, you see it everywhere? Maybe I just never looked for MacBooks before a week ago when I joined the Mac Club?

OS X Utilities I've known and loved...

Posted by Justin Reagor Mon, 14 May 2007 00:05:00 GMT

I’m some what of a OS X app junkie. I’ve ran or tryed almost everything, and love installing new apps. Here’s my list of Mac apps I’ve grown to love (in no particular order). Feel free to comment with any other suggestions or likes/dislikes.

  1. Textmate, number one favorite text editor of ALL TIME! Just try it.
  2. QuickSilver, A unified, extensible interface for working with applications, contacts, music, and other data.
  3. Optimized Firefox, optimized versions of Firefox (though I have had problems with this in dual monitor). Its great to have a re-compiled version of Firefox built exclusively for the platform of OS X your on. You can also choose to have the normal Firefox forms and buttons or OS X ones (like Safari).
  4. Transmit, FTP/SFTP/WebDAV/etc. For those times you just don’t feel like using the command-line for transferring files.
  5. Coda, if it would only support Textmate bundles/snippets it would probably be my next favorite web development text editor. Also check out Desktastic
  6. CSSEdit, helps when your learning CSS.
  7. Script Debugger 4, Allows you to write OS X scripts in either Applescript and/or Javascript! You can also build them into .app packages for distribution.
  8. RDoc Widget, just started using this, it also supports the Rails API (and any other web based RDoc?) Must have if you develop on Rails/Ruby.
  9. NetNewsWire, give love to this desktop RSS reader. Though I still find myself using Google Reader until I script my own favorite article feed. NetNewsWire supports massive scripting in OS X!
  10. Ruby OSA, start scripting control for all your favorite OS X apps using your favorite programming language!
  11. XML/XSLT Cocoa Utility Apps, check the bottom right side, this guy has built some very groovy Cocoa apps for XML/XSLT. XML/RPC Client, XMLmate and XSLTmate Bundle, mark-up validators and more!
  12. svnX, Visually see your entire repository using this excellent svn GUI frontend! I’ve also linked the main product page for other useful apps.
  13. OmniGraffle, The Omni Group makes probably one of the best graphing tools I’ve ever used, along with other fine products such as OmniOutliner and OmniPlan. Checkout OmniWeb which is a browser with some neat ideas. Also, OmniDazzle seems to be used in many OS X user presentations.
  14. Yojimbo, keeps track of every single password and little tidbit of information you keep laying around in different places.
  15. SpamSieve, a VERY powerful spam filter for Apple Mail.
  16. The Missing Sync, even though I’ve never used it, I hear this is the best syncing utility for Treo, Windows Mobile, Blackberry and Sony PSP devices.
  17. VirtueDesktop, until Leopard gives us “Spaces” we’ll have to use this utility (development has halted though).
  18. SSHKeychain, takes care of loading your ssh keys into memory. Also intergrates with OS X’s Keychain.
  19. Graphviz, views graphs of the .DOT file extension type. Great with RailRoad!
  20. MacTheRipper, used for copying DVDs that you’ve created and that you own! ;)
  21. HandBrake for loading your DVDs into your iPod! Now with Apple TV support.
  22. xScope, a powerful set of tools that are ideal for measuring, aligning and inspecting on-screen graphics and layouts.
  23. iPulse, graphically displays the inner workings of Mac OS X on the desktop or in the dock.
  24. Go go Redball!, a little fun for your dashboard.

Enjoy!