Hello,
I know the advantages of Constants, whether entered in the Constants Editor and/or localized. As well as the Const
keyword. The main advantages being that you can rely on the values, because they can’t be changed.
But if a “mutable” type is declared as a constant (if such a thing can happen?), does the Xojo compiler provide some optimization?
Also, what about when embedding a hard-coded string (that won’t be changed programmatically and only occurs once as a unique value) in something like:
Dim myNodeList As XmlNodeList = rootNode.Xql("/root/node/someList")
Is there any benefit to declaring that hard-coded string first as a constant, or does the compiler know that hard-code values (like the case above) should be treated like constants?
I tried searching the docs and the forum, but couldn’t find clarity. I hope my question makes sense. Thanks.