I hate to ask what appears to be a simple question, but since I can’t answer it for myself I figured I might as well ask the experts. Given this particle.variable example:
Particle.variable("temp", tempC);
What does the “temp” parameter represent? I know that tempC is the variable name used in code when you assign a value to the variable, and that the two parameters do not have to be identical. So, why two parameters and what does the first one represent?
Whatever you want to call them
I personally like to make them at least somewhat descriptive so I know what I’m looking at when I see them in an overview. And I try to make them match with each other a bit. Wouldn’t make a whole lot of sense to go with Particle.variable("temp", humidity); for example.
Up to 20 cloud variables may be registered and each variable name is limited to a maximum of 12 characters.
So sometimes I have this internal variable called myInternalCuteVariable that I cannot map in the cloud. So the mapping allows me to have my cute internal var with that long(er than 12 chars name) but I can expose it nonetheless as cuteVar, for instance.
Cheers,
Gustavo.
One other thing I’d consider good practice rather than a rule: Don’t use blanks
Even when blanks are allowed (just like in path names in Windows or Linux systems) I’d avoid them wherever possible and stick to the same rules of naming them as I would name any valid C variable (although leading digits can be acceptable for filenames and directories - as exception to the “rule” )
Rather use CamelCase to stress word boundaries than split them up with blanks (or maybe even underscores).