Naming conventions for not-exactly-private methods in addons


#1

I’ve noticed that in the Ember code-base, many private functions and attributes are preceded by an underscore, eg. _myPrivateFuction(). I’m developing an addon that injects properties into common Ember objects, such as Components and Routes. These properties aren’t technically private, as a service will be accessing them. But I want to discourage developers from using these properties themselves. Should I just use the underscore approach? Or is there a more conventional way to alert developers that this property is for internal use within the addon only?


#2

I’m in a similar boat and wondering this as well. Not sure whether to do the _myFn() {} or just add a @private (or both), or something entirely different. Would love to hear what others think.


#3

One convention I’ve noticed in Ember is the double underscore, such as __meta__. Wonder if that might be what we’re looking for?