 |
 |
Should I go back and prefix my class names? (Obj-C/Cocoa)
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2001
Status:
Offline
|
|
Ah! I started a project a few months ago, and originally thought that it would be a small project, so (in my lack of foresight) I named my classes willy-nilly. Now, many classes will be public, along with notifications, constants, etc. There are about 50 classes in my project. I'm just wondering whether people think it is worth the effort to go back and prefix my class names/notifications/whatever?
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Oct 2001
Location: London
Status:
Offline
|
|
Originally posted by Ibson:
Ah! I started a project a few months ago, and originally thought that it would be a small project, so (in my lack of foresight) I named my classes willy-nilly. Now, many classes will be public, along with notifications, constants, etc. There are about 50 classes in my project. I'm just wondering whether people think it is worth the effort to go back and prefix my class names/notifications/whatever?
If they are going to be public - absolutely.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2001
Status:
Offline
|
|
Should I bother prefixing my private classes? Also, would one tend to use a company-specific prefix or an application-specific prefix (I've seen examples of both).
*sigh* I'll start now then...
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
If they're specific to your app, use an app-specific prefix. If you want them to be reusable in other applications, you can use a company or person-specific (if you're just working along) prefix.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by Ibson:
Should I bother prefixing my private classes? Also, would one tend to use a company-specific prefix or an application-specific prefix (I've seen examples of both).
*sigh* I'll start now then...
Couldn't you just use Project Builder's built-in find-and-replace ability? It seems like it wouldn't be that hard with that.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Oct 2000
Location: Portland, OR USA
Status:
Offline
|
|
Isn't there some way to create a namespace around our classes?! Like a package in Java or namespaces in C++. This is the only thing I dislike about Objective C.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2001
Status:
Offline
|
|
Originally posted by LordJavac:
Isn't there some way to create a namespace around our classes?! Like a package in Java or namespaces in C++. This is the only thing I dislike about Objective C.
Unfortunately, no. The Objective-C runtime has a single, flat namespace per process for all exported symbols: such as global variables, class names, nonstatic functions, and categories. Protocols have a separate global name space of their own.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jan 2001
Location: Meida, PA USA
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|