Using underscore in C# has some advantages. For instance, it let's you
filter properties vs. fields when invoking code completion lookup. Of
couse IDE's usually colorize this aspect, and that is the typical
counter-argument raised, however that is of little assistance when
reading code without having these things resolved i.e. from with
Fisheye or similar. I used to use underscore in Java code, but got
converted and aligned over the years by the conservative Java
community. I refuse however, to stay within 80 columns or append
"Impl" to implementing classes.

On May 3, 10:09 am, Roland Tepp <[email protected]> wrote:
> Extremely short-sighted and ill informed answer.
>
> Python, for example uses leading underscores as a convention to indicate the
> locality and intended visibility of the  variables and methods.
>
> Single underscore usually means "local variable" (as in local block scope)
> and double leading underscores to indicate that a variable is private /
> local to the module / class scope.
>
> I've also seen similar convention in some C / C++ programs and may recent
> brush with C# taught me that (at least in public Microsoft's code) uses
> leading underscore for private fields as a convention.
>
> In Java, indeed, the leering underscore in variable names is if not illegal,
> largely frowned upon...
>
> esmaspäev, 2. mai 2011 21:02.58 UTC+3 kirjutas Andrzej Grzesik:
>
>
>
>
>
>
>
>
>
> > None whatsoever
> > On 2 May 2011 19:45, "Chris Koerner" <[email protected]> wrote:
> > > Just curious, under what circumstances in ANY language do you use an
> > > underscore in front of a variable/method/object?

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to