Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • I personally like to use such prefixes which helps in understanding what type of variable it is from any part of the code where "c" stands for constant and "str" tells its datatype. Commented Sep 23, 2015 at 11:14
  • 5
    It is a free world, however you are in a minority. Microsoft's guidelines state "X DO NOT use Hungarian notation." msdn.microsoft.com/en-us/library/ms229045.aspx So something to think about if you are going to have other more standard developers read and understand your code. Commented Sep 23, 2015 at 11:27
  • 2
    Nothing is stopping me from using a int c_strMyConst, which is one of the reasons the Hungarian notation shouldn't be used. That is ofc one example that wont hurt you much as you will very fast find out that the string is actually a int. But in a C++ application with dozens of different stringtypes - bstr, cstr, 8bit per char, 16 bit per char, etc., accidentally misnaming a variable instead of relying on the typeinfo from IDE can create hours of hurt. Commented Sep 23, 2015 at 12:44
  • 2
    The correctness of this answer would become much more evident if you consider that instead of "Hello", the string could be "Χαίρετε". Do you have the slightest clue what Console.WriteLine("Χαίρετε") does? You would have to know Greek to be able to tell that it is a greeting like "Hello". Commented Sep 23, 2015 at 13:12
  • 1
    An observation on the conversation between @GawdePrasad and Froome: the biggest problem of whatever coding style guideline is that it discourages people from using their own judgement. Saying "a big-name company recommends doing this" (tends to) automatically win the debate, without even discussing pros and cons. That is sad. Commented Apr 8, 2017 at 9:04