suppose I have code like this
someFunction:function(userId){
var url=SomeClass.SomeNetworkConnector.SOME_URL;
if(url !== undefined && userId !== undefined){
this.openURL(url+"?userid="+userId);
}
}
Initially I think the name of actual constant SomeClass.SomeNetworkConnector.SOME_URL is too long, so I use a variable with shorter name to hold it, and then use it later.
But I'm struggling if I should do this, my reason to oppose above is : SomeClass.SomeNetworkConnector.SOME_URL is already a well defined name of the constant, is it misleading to rename it as another variable? Should I always use SomeClass.SomeNetworkConnector.SOME_URL instead of creating a shorter variable name?