logo       

Re: ambiguity between local variable assignment and writter method: msg#01159

lang.ruby.general

Subject: Re: ambiguity between local variable assignment and writter method


"Justin Johnson" <justinj@xxxxxxxxxxxxx> wrote in message
news:3d5783ed$1_8@xxxxxxxxxxxxxxxxxxxx
>
> > Dunno about George, but I consider $ junk and I am very vary of using
> > @@. Ironically we're arguing about writer methods inside classes, which
> > also distances us from the @.
>
> Personally, I disagree. I do a lot of C++ programming with large systems
> and one of the first standards we adopted was variable name
identification.

I'd like dot name ".x" instead of "@x" for referencing members.
Incidentally, this is also what the C99 standard adopted. "..x" would then
be a class reference, however, I'd prefer "type.x" or "class.x" over "@@x"
or "..x". "self.x" is an alternative to ".x".

I wouldn't have any great problem with "_x" or "x_", but I think this is
already part of the name namespace.

As usual I'm probably overlooking some blatantly obvious that prevents this
from being possible.

In C++, Microsoft world tends to use "m_x" for members, I'd personally
prefer "x_" and sometimes "_x" for private (I'm hardly consistent over all
my applications).

Mikkel






<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise