[Pythonmac-SIG] NSTableView and NSOutlineView backgrounds

Dinu Gherman gherman at darwin.in-berlin.de
Tue Oct 14 15:30:17 EDT 2003

Bob Ippolito:

> Also, don't the newer compilers complain when you declare variables in 
> the middle of code?  Wouldn't you have to put a "NSRect bounds;" at 
> the top of the block?  Obviously you could just do [NSBezierPath 
> fillRect:[self rectOfRow: row]] .. which is probably how I'd have done 
> it in the first place.

All valid points, but still, I didn't mean to bash Objective-C at all.
My comparison was about my basically 7 pyLOC against something like
20-30 objcLOC (depending on how you count, braces, etc.) of Evan Jones'
code (including other methods which are perhaps not strictly needed).
I *do* like Obj-C a lot, but Python is less to read and type, and also
faster to test and get running...

> Along the same lines, ObjC doesn't have a short way to say anything 
> (no operators).  Probably my favorite feature of Python are strings, 
> lists and dicts, with all the great __setitem__/__getitem__ stuff to 
> go with it.  In ObjC, a+b never means anything useful, unless a and b 
> are primitive C types.. that's obnoxious, because you'd have to say 
> a.add_(b) or something like that... Imagine writing an equation like 
> that.  Sure, in ObjC you can use int, long, float, double.. but what 
> about equivalents to Python's long or complex?  What about doing 
> arrays/matrices (Numeric), etc.  You can't create a NSDictionary like 
> {a:b}.  Operators and other syntax is extremely important, more so 
> than a forced message passing syntax.  If you want message passing 
> syntax just use keyword arguments all over the place: [...]

That's quite a few things I already wanted to list in my upcoming
article. ;-)

Drew McCormack:

> Where I prefer Obj-C/Cocoa:
> Possibility of static typing (makes large programs more readable, and 
> catches a few bugs at compile time)
> Design of libraries. Cocoa is beautifully designed and stable. I have 
> the feeling python's libs have evolved in a less stable way. With each 
> new release of python, things get replaced, indicating they weren't 
> that well done the first time round.

Unfortunately, this is true, especially of the standard library.
It lacks a huge amount of consistency, which Cocoa, being an in-
house year-long development, definitly has - sigh! And sadly, as
you would expect in an Open Source project, nobody seems to care
about that, at least not enough to make a difference...


Dinu C. Gherman
"The whole point of brainwashing, is that those being brainwashed
don't know it." (Graham Haley)

More information about the Pythonmac-SIG mailing list