[Cocoa-sharp] Cocoa namespace

Chuck Esterbrook chuck.esterbrook at gmail.com
Thu Jan 24 12:48:33 EST 2008


On Jan 24, 2008 3:52 AM, Andrew Brehm <ajbrehm at gmail.com> wrote:
> If it's not too late...
>
> Could Cocoa classes revert to their NS... names in the Cocoa namespace
> in future versions of CocoaSharp?
>
> I am thinking Cocoa.NSTextField rather than Cocoa.TextField.
>
> That would make documentation easier and also allow better
> differentiation from other .NET classes in other namespaces. It's not
> a problem for NSTextField, but I think it could be confusing for
> NSString and .NET's native String class.

I agree.

And coming from an Objective-C background, I was also surprised that
the namespace was Cocoa instead of FoundationKit, AppKit, WebKit, etc.
In Apple development, "Cocoa" is an umbrella term, not an actual
framework name.

Another valid alternative would be to use the name prefix as the
namespace since that's the point of the name prefix in Objective-C:
it's a poor man's namespace. So NS.String, NS.TextField, etc. In .NET,
namespaces can span assemblies so there's not even a problem if we end
up with multiple .dll's.

"NS.String" still reads close to the Objective-C and is reasonably
short-and-sweet such that you wouldn't need to say "using NS;".

(Ack! I have to fix the "To:" field when I reply to this mailing list!)

-Chuck


More information about the Cocoa-sharp mailing list