On 02/17/2014 11:18 PM, Justin Dolske wrote:
On 2/17/14 12:41 PM, Ehsan Akhgari wrote:
On 2/17/2014, 9:15 AM, David Rajchenbach-Teller wrote:
Do we have naming conventions for new xpcom interfaces?
I believe that I have seen all three forms on the tree. I need to pick
one for my new bug. Which one should I pick?
Avoid ISomething since that means something on Windows.
And of course nsSomething means something on OS X (well, ok, NSSomething).
I think most people still name their interfaces nsISomething. The
mozISomething naming convention seems to be specific to the storage
code, some of places code, and things such as mozIApplication or
mozIJSSubScriptLoader. The first two are generally written by the same
people, and I can't find a lot of other examples other than the two
names I mentioned.
I vaguely remember there being some interest in transitioning to a "moz" (Mozilla) prefix
instead of "ns" (Netscape).
ns hasn't meant Netscape for ages. It is just dummy NameSpace :)
You may have noticed that
Netscape is no longer a thing, and so cargo culting around a mysterious
two-letter prefix is a little weird. OTOH, I've never heard of a proposal to
switch all nsIFoo to mozIFoo, and so there's so benefit to having one
consistent prefix instead of two. One might also wonder if it would be better to
just drop the prefixes entirely, were we to do any kind of mass change. Ditto
for filenames.
tl;dr: you can keep using nsIFoo unless you have an industrial yak-razor and
the will to use it.
Justin
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform