You are not logged in.
Pages: 1
Merry Christmas guys. Best wishes to everyone.
This thing always puzzled me, why the use of
_var=abc
instead of
var=abc
AFAIK it is only a preference thing, no usage at all.
Thank you
Offline
If you're using Python, then _Var means it's supposed to be a private variable, so treat it as such.
Any other time:
There's no language-defined meaning - it's just a convention some people use to distinguish instance variables from local variables. Other variations include m_foo (and s_foo or g_foo or static variables) or mFoo; alternatively some people like to prefix the local variables (and parameters) instead of the instance variables
Offline
AFAIK it is only a preference thing
Yes, in batch files there is no syntax that requires an underscore in a variable name.
It may be used because at a command prompt you can type
set _
and it will list all your variables to the screen - a useful tip for debugging.
The same technique can be used by prefixing your variables with a
and you can type set a to show them all.
Last edited by foxidrive (28 Dec 2015 14:13)
Offline
Pages: 1