What's the coding standard for naming a private method in a language which does not have the private modifier? Specifically, I am talking about Javascript. Below I've placed an underscore at the end of my private method's name, but a colleague told me that underscore is usually for class fields.
var MyClass = Class.create({
initialize: function() {
alert('constructor');
},
publicMethod: function() {
alert('i am public');
},
privateMethod_: function() {
alert('i am private');
}
});

_for private and__for Python internal names. You can use_names, which are simply concealed in a few ways. You should not use__names because the mangling makes debugging remarkably hard, and it exposes you to the possibility that a future release will interfere with your name. Use_in Python for "more-or-less private". – S.Lott Jan 26 '12 at 0:59