On 5/16/05, dave buhler <[EMAIL PROTECTED]> wrote:
>  What's common usage for variables with underscores in a class architecture?
>  
>  __variable vs _variable vs variable?

I hope I'm getting this right... somebody correct me if I'm wrong:

 1.  Double underscore for private variables holding values for public
properties.  For example selectedIndex is internally stored in
__selectedIndex and then wrapped into a getter-setter pair.
 2.  Single underscore for other private variables.
 3.  No underscore for public variables (although if a variable does
not have an underscore it's not necessarily public, so there's some
inconsistency here).

I haven't seen any document on these conventions (but that's most
probably my fault).  Also things are likely to change in the future,
so I wouldn't rely on these naming conventions for my own classes.

Personally, I think only #1 above really makes sense (i.e. I don't see
why _measuredPreferredWidth couldn't be just measuredPreferredWidth).


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to