views:

149

answers:

2

I'm looking to choose a namespace for a library I'm writing and I'd like to avoid conflicts with other namespaces.

Does anyone know of a website that lists all of the class prefixes in use?

+6  A: 

http://www.cocoadev.com/index.pl?ChooseYourOwnPrefix is probably your best bet. It's not "official", but it's a place a lot of devs would look.

In practice, as long as you don't use one that Apple uses, you'll probably be fine.

bdrister
As bdrister says, as long as you don't use an Apple prefix, you won't run into many problems at all. With the iPhone, your app is sandboxed and won't load any dynamic/shared libraries, so you won't clash with other 3rd party apps.
Jasarien
Perfect, thanks!
Brian King
Yes, I don't bother with prefixes at all for applications - only frameworks and plugins that are meant to be used by other apps
JeremyP
http://github.com/KingOfBrian/VocalKit/ - I've added VK to the list above. Just wanted to make sure I wasn't stepping on an obvious library.
Brian King
+3  A: 

As an alternative to initial-letters prefixes:

  • If you're writing an application, use no prefix. You're unlikely to encounter another class named AppController in your app.
  • Otherwise, use the product name as the prefix. For example, if you've written a color picker named “Whizbang”, name its principal class “WhizbangColorPicker”.
Peter Hosey