Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Darkroom

Guest
Original poster
Dec 15, 2006
2,445
0
Montréal, Canada
i've just read the following:

"To keep the global variables from conflicting with another company's global variables, you have prefixed them with BNR (for Big Nerd Ranch). Global variables from Cocoa are prefixed with NS. These prefixes are important only when you start using classes and frameworks developed by third parties. (NOTE that class names are also global. You might prefer to prefix all your class names with BNR to keep them from conflicting with anyone else's classes)"

i understand it's extremely common for developers to have certain classes often titled the same, namely "AppController". so if two applications are running on one computer, and both applications have classes called "AppController", will they conflict with one another?
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
No. This is only for cases of code reuse through libraries, etc. Conflicts will only occur if the classes are defined in the same namespace in one program.

If I wrote a great graphing library, but called my classes MyClass, MyController, AppController, etc. there's a high probability when someone tried to use it in their program, they'd have issues using my library with some classes they already have. If I called a class NSArray, you couldn't use it with the foundation classes, so you couldn't use it in any project, really.

-Lee
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.