I have such a big problem naming my variables and classes that i spend more time thinking about how to name them then programming actual code or debugging it. This might sound really stupid but this bother me alot. Isnt there some standard way of naming them, Some set of rules that could apply to all variables and classes i will create in the future?
Especially a for loop like
std::string sName=i cant type qoutation marks on this stupid keyboard
for(int i=0;i<sName.length();i++);
this is pure horror for me wat would be a apropiate name for the integer i?
It's a pity, but there's no standard naming convention, so there's a near absolute chance that every other piece of code that you pick up will be written in a different style. It can be a bit annoying at times, but that's the world we live in.
Selfishly, I propose this set of rules that reflect my own preferences:
1) Please don't use Hungarian notation.
Jokes aside, I hope that helps.
In response to your latest edit:
1 2
std::string name = "Bob";
for(int i = 0; i < name.length(); i++)
i seems to be a common identifier (possibly abbreviating "index"?) for looping.
The problem lies when you get a blob of code like this:
1 2 3
float a, b, e, g;
int x, z, t;
//code that uses them all follows
Hungarian notation makes it harder to read names, and since we all have IDE's that tell us the type of something if we just hover the mouse over the name, it doesn't add any information. Also, it binds the type to the name, so if you'd change the type of a variable during refactoring you'd also have to change its name.