On 02/05/2011 19:15, Cédric Beust ♔ wrote:
On Mon, May 2, 2011 at 10:45 AM, 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?

Very dependent on the language, its culture and its users. Overall, underscore on methods is usually something you use to mark some sort of concealment (for example to avoid possible overriding) and on fields, it's a commonly accepted practice in C++ and to some extend, Java and C#. I've occasionally seen underscores as a convention for local variables or method parameters.
+1

Python uses double leading and trailing underscores on 'special' methods, e.g. __init__().

It's also a convention in Zotonic (erlang web framework) for page templates.  Anything beginning with an underscore is a visual component meant for including in other pages, not a page in itself.

 - S.

--
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