Re: AppKit source available as reference?
Re: AppKit source available as reference?
- Subject: Re: AppKit source available as reference?
- From: Chris Meyer <email@hidden>
- Date: Thu, 28 Jun 2001 10:50:20 -0700
Hi Rob,
Just a few quick responses:
Subclassing is useful only if the classes have been designed for sub-classing.
In my case I thought it would be nice to be able to use NSTextView to
generate an NSBezierPath object representing the text (such that I
just had to fill or otherwise manipulate it). Unfortunately the
NSTextView class is not designed to be subclassed in that particular
way (that I could tell from the documentation).
I came up with another solution for my particular problem and if I
had had source available and had pursued a 'modify the class'
approach it would have undoubtedly taken me more time. So in this
case it was better for me NOT to have the source.
I think a trend in programming is to get things done properly in the
fastest way possible (duh!). Philosophy of information hiding aside,
source code would be good when it speeds up your development process.
I can think of numerous cases of Cocoa programming where it would
have saved me lots of time to be able to view the source. For
examples of the problems I probably could have solved myself, just
search for my posts on OmniGroup or on this list if it ever becomes
searchable! Ideally I could have contributed fixes back to Apple. I
guess that's the point of open source... oh well..
Chris
So... my request is for Apple to make the source code available
(not open source), just as a reference.
Well, let me put it this way: I can see it as being a good thing,
but I can also see it as being a bad thing.
It would be neat to be able to see some implementation details, just
out of my own curiosity, but then again, that violates the
object-oriented nature of it; objects hide their implementations.
You shouldn't have to use them as a reference.
As for slight modifications, there are several options: subclassing,
subclassing and posing, and categories.
Basically, I don't think it would be a particularly good idea,
because the whole idea of objects is to get you to stop caring about
how their implemented, and just use the interfaces.
Now, it would be better if the interfaces were better documented,
but I think we've all beat that horse to death by now.
-- Rob
We are all in the gutter, but some of us are looking at the stars. -
Oscar Wilde
--