Notes from learning Cappuccino

5 views
Skip to first unread message

TGK

unread,
Nov 9, 2009, 8:24:18 AM11/9/09
to Cappuccino & Objective-J
As a Cappuccino newcomer I’ve been having a good time playing around
with it. As I get up to speed I’ve been putting my “notes” online as
a collection of articles/tutorials. They may be of help to others
getting started with Cappuccino. You can check them out at

http://cappnotes.worldofkrauss.com/

As an aside (and a shameless plug), I’m looking to “upgrade” my
airfoil database site (http://airfoils.worldofkrauss.com/). The
current site uses Ruby on Rails and I’ve made a rather extensive
rework using the Erlang-based Nitrogen framework (http://
nitrogenproject.com/) which you can see at http://airfoils.worldofkrauss.com:8888/.
Overall Nitrogen is pretty nice, but the results feel a little dated.
It looks like Cappuccino could be used to make a totally different
beast. I look forward to knowing enough to really start building with
it and seeing just how desktop-like the site can be.

Nicholas Small

unread,
Nov 9, 2009, 1:20:27 PM11/9/09
to Cappuccino & Objective-J
Hi TGK,

This is great! Thanks for posting a helpful resource. You may also
want to post it on CappuccinoFlow.com. A few things I noticed briefly
going through the articles:

We generally wrap the main body of -init methods in if (self):
- (id)init
{
self = [super init];
if (self)
x = y = z = 0.0;
return self;
}

More importantly though, you never really need to initialize a
variable to an empty value, like 0.0. Also in ObjC/J, we like to use
more descriptive variable names, so instead of var p = ... try var
point = ... The section about globals vs. var scoping is right on, but
you may also want to mention that ivars do not use var and are local
to the object.

I'd question whether you'd even want to include the section about
accessing the JS objects directly through dot syntax. While it's
possible, it is entirely beyond bad form; you're actually using an
entirely different programming language. I think it would be better to
just go write into accessors. Just a stylistic thing, we don't like a
space after a colon. - (id)initWithX:(float)newX Y:(float)newY Z:
(float)newZ. Also instead of a -string method on the class, if you
just overwrite -(CPString)description, whenever you CPLog/print (so
print(thePoint)) the object it will output the string you return.
Finally, when you're talking about @accessors, you may also want to
talk about the options you can pass, like property= and readonly.

A few things about the -add: method. You should use setters, [self
setX:x + [otherPoint x]]; This allows things like KVO to work
properly. I know that our public API's will almost never return self
for chaining (though sometimes I wish they did), but I suppose that's
a personal thing.

Other then those issues, it looks great. Thanks again for contributing
this.

--Nick

On Nov 9, 8:24 am, TGK <thomas.kra...@gmail.com> wrote:
> As a Cappuccino newcomer I’ve been having a good time playing around
> with it.  As I get up to speed I’ve been putting my “notes” online as
> a collection of articles/tutorials.  They may be of help to others
> getting started with Cappuccino.  You can check them out at
>
> http://cappnotes.worldofkrauss.com/
>
> As an aside (and a shameless plug), I’m looking to “upgrade” my
> airfoil database site (http://airfoils.worldofkrauss.com/).  The
> current site uses Ruby on Rails and I’ve made a rather extensive
> rework using the Erlang-based Nitrogen framework (http://
> nitrogenproject.com/) which you can see athttp://airfoils.worldofkrauss.com:8888/.

Ross Boucher

unread,
Nov 9, 2009, 3:37:52 PM11/9/09
to objec...@googlegroups.com
Looks great. Still on the way home, but I'll take a closer look
tomorrow. The Doxygen config changes look like a good idea.
Reply all
Reply to author
Forward
0 new messages