I'm looking for a clean and common-place way of organizing/categorizing variables and functions. In otherwords, I want a method for clearly separating variables and functions that belong to one add-on from those in another. This is mostly for the sake of readability avoiding name conflictions. I'm not talking about making them invisible; just distinct.
Namespaces sound like they may be able to work to this extent. However, I'm not entirely clear on the concepts of objects and classed. It's been awhile since I've used any object-oriented language.
One thing I've seen in various add-ons is the use of "::" in variable names, preceded by some keyword that denotes which add-on said variable belongs to. For instance...
$RTB::Version = "4.05";
$RTB::Path = "Add-Ons/System_ReturnToBlockland/";
Now, I'm aware that namespaces use "::" in some regard. However, I've also read that it's possible to name a function or a variable with "::" without it being associated with a namespace. It seems to me that the example I've given utilizes the latter property, based on the use of the global variable sign, '$'. Am I correct in assuming this? Could it go either way? Whichever case it is, is it good practice?
P.S. I apologize for having asked two questions in one post. Although, I figured it be a bit redundant to create another topic for two inquires so closely related.