I searched the forum, but I couldn't find the answers why it should be avoided, only why it's not a silver bullet. So I don't think this question is a duplicate.
Is there a VALID reason why I should unlearn Systems Hungarian I'm used to?
So far I see the following benefits in using it:
- Consistent variable naming
- You see type without searching (intellisense is dead/indexing half of the time, so it's still a valid reason)
- Semantics can still be packed into second part of the name
And following downsides:
- It annoys some people (no idea why)
- If type is changed, the type might not match the naming of the variable (I don't think it's valid reason, types are changed rarely, and you have "rename all")
vector<string> vecCityNames; wstring strCity = L"abc"; //more code here vecCityNames.push_back(strCity);
is worse than:
vector<string> cityNames; wstring city = L"abc"; //more code here cityNames.push_back(city);//Are we pushing back int on a queue? Float on a stack? Something else?