Menu

#2 Underscore user preference

open
nobody
5
2004-08-09
2004-08-09
No

PB's code generator prefixes instance variables with an
underscore. Some people like this, and others don't. Apple
have informally asked Cocoa developers not to use the
underscore prefix, as it could cause name clashes with their
own use of the underscore in the Cocoa classes.

PB should have a user preference that allows developers to
specify the prefix that they want on their generated
instance variables, e.g. '_', '', 'my', '_my' and so on.

If developers use the 'raw' variable names in their code,
rather than accessor methods, then a change to the prefix
will mean they have to update the code in their methods
and states. PB could provide a global variable replacement
capability, applied at the users discretion, when the global
prefix is changed.

Discussion


Log in to post a comment.