参考具有磅/哈希符号的JavaScript实例方法 [英] Referring to javascript instance methods with a pound/hash sign
问题描述
此问题类似于为什么Ruby文档中的方法之前是一个哈希符号?
我明白为什么在Ruby实例方法中进行了一个井号,有助于区分讨论 SomeClass#someMethod
from SomeObject.someMethod
并允许 rdoc
工作。我知道PrototypeJS的作者欣赏Ruby(有很好的理由),所以他们使用他们的文档中的哈希标记约定。
我的问题是:这是JavaScript开发人员的标准做法,还是只是Prototype开发人员?请问另一种方式,是否适用于在 SomeClass#someMethod
中引用注释/文档中的实例方法?或者我的文档是否参考SomeClass.someMethod?
我认为它来自javadoc。
http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html# {@link}
This question is similar to Why are methods in Ruby documentation preceded by a hash sign?
I understand why in Ruby instance methods are proceeded with a pound sign, helping to differentiate talking about SomeClass#someMethod
from SomeObject.someMethod
and allowing rdoc
to work. And I understand that the authors of PrototypeJS admire Ruby (with good reason) and so they use the hash mark convention in their documentation.
My question is: is this a standard practice amongst JavaScript developers or is it just Prototype developers who do this?
Asked another way, is it proper for me to refer to instance methods in comments/documentation as SomeClass#someMethod
? Or should my documentation refer to ``SomeClass.someMethod`?
I think it comes from javadoc.
http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html#{@link}
这篇关于参考具有磅/哈希符号的JavaScript实例方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!