I am describing an algorithm in a journal paper. In this algorithm I have a few variables. I gave them the same names as in my source code (C++ source of the algorithm, not LaTeX source). So I have variables such as:
- new (new node that is being inserted)
- reference (arbitrarily chosen node)
- x (generic looping variable)
In computer programming it is good practice to give variables meaningful names. However when reading other articles describing algorithms I often see abbreviated names. In my case it would be:
Is this a good practice? Is there a difference between programming and mathematical texts?
Another thing is the mode in which to write these variables in text and in an algorithm environment. Should I use:
Or perhaps use one convention in inline text and a different one in equations and algorithm environments?
I couldn't find any relevant information in the editor's manual for the journal and also nothing relevant in the LaTeX class manual. All they say is to make variables italic, so that they are not confused with units (for example W can be confused with Watt).