Article 5S0VY Is there a convention for naming variables?

Is there a convention for naming variables?

by
rblampain
from LinuxQuestions.org on (#5S0VY)
When one has to name variables in different contexts, is there a prevailing convention to prefix the variable with a notation indicating where it belongs?
For example, variable contents are passed between Javascript, Local Storage, HTML(forms) and server side scripts.

I got into the habit, possibly a bad habit, of making the variable name slightly different for fear of any conflict when there may be no conflict possible.

If not and if useful, is it an idea to copy the "hungarian notation", which prefixes a variable name with "s" for string, "i" for integer etc and starting the variable name with a capital letter? In my simplistic reasoning, the variable name can be prefixed with "js" or "lc" or "ht" etc (perhaps already applied in "good programming").

Thank you for your help.latest?d=yIl2AUoC8zA latest?i=Czak0TweRCQ:SnslFThxohE:F7zBnMy latest?i=Czak0TweRCQ:SnslFThxohE:V_sGLiP latest?d=qj6IDK7rITs latest?i=Czak0TweRCQ:SnslFThxohE:gIN9vFw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments