Vil*_*ili 2 naming-conventions
function get_IfUnsetAlsoSet_SomeGlobalVariable() {
if someGlobalVariable is not set {
someGlobalVariable = somedata
}
return someGlobalVariable
}
Run Code Online (Sandbox Code Playgroud)
我应该给出这样的名字吗?- > getSomeGlobalVariable()
如何命名这些getset函数?
我想一个名字getSomeGlobalVariable()应该很容易,没有混乱.
基本上,您不必在方法名称中提供完整的逻辑.