Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6552791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:30:12+00:00 2026-05-25T12:30:12+00:00

In objective-C it is common to prefix two or three letters to the beginning

  • 0

In objective-C it is common to prefix two or three letters to the beginning of a class name or C function, for Example an array class is named NSArray the NS because it was originally developed by Next Step. This avoids namespace collisions. Now if I was to go off and create my own library it’s common to prefix my initials to the beginning of new classes I create, for example I might decide in my infinite wisdom that the world need another array class and I might create a brand new array class called a BGArray .

So now I’m working on an open-source project that was originally developed by Prince Witherham The Second (Totally fictitious name) and He’s got all the classes in the project prefixed with PW2. I want to expand on the project and add a few classes of my own to the project, How should I name these new objects, Should I:

  1. Prefix the new objects with PW2: This keeps consistence across the project but could create namespace collision for the Prince, if say for example I create a new PW2Foo class and the Prince already has a PW2Foo class in some other project that he is working on.

  2. Prefix the new objects with BG (My initials): This would avoid any namespace collisions but would put my initials on something I didn’t really start and it could also add confusion to people using the project in the future.

  3. Ask Prince Witherham the Second what he would prefer: This is probably the most strait forward but I can see it being problematic, if the Prince isn’t as activly maintaining the project anymore because he is vacationing of on his private island where they don’t always have an internet connection.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:30:13+00:00Added an answer on May 25, 2026 at 12:30 pm

    I believe it’s common to prefix classes with your own name, but also quite common to prefix with the name of the project. Note that NS is not the only Cocoa prefix: there is CG as well, and CV, and CA, all depending on which framework the class comes from. You get the point.

    As such, I believe the best of these options (although option 3 can certainly override it, if the project manager would prefer something else) is option 1: all the classes in the project should have the same prefices.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've two ArrayList both containing Integer values. My objective is to get identical/common/duplicate values
This is probably a common Objective-C question reported by Java coders, but I don't
And is it a common idiom in Objective-C. I've only seen this used on
What are the most common reasons for an outlet (a class property) not being
In Objective-C, it's common to override -description with a method that prints the object
As is common knowledge, calls to alloc/copy/retain in Objective-C imply ownership and need to
You are given two sorted integer arrays, which have some common integers. Any common
It is common practice to write MyClass* obj = [[MyClass alloc] initWithX:X] in Objective-C.
Possible Duplicate: Method Syntax in Objective C So I totally get the more common
I need to implement kind of illustrated function ( ratio = somefunction(time)) in Objective-c.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.