Skip to main content
11 events
when toggle format what by license comment
May 9, 2020 at 15:08 comment added sergeyski.com Conversation deviated a bit from original question about where to declare string constants. You can give semantic meaning to local a string constant too.
Apr 16, 2019 at 0:24 comment added Grim I can understand using hungarian notation for non static languages but personally I would not use it. However in statically typed languages the biggest arguments are maintenance, and breaking the DRY principle. Both are a no go for me...
Apr 25, 2018 at 18:03 review Suggested edits
Apr 25, 2018 at 19:20
Apr 8, 2017 at 9:04 comment added RayLuo 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.
Sep 23, 2015 at 13:12 comment added Mike Nakis 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".
Sep 23, 2015 at 12:44 comment added kat0r 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.
Sep 23, 2015 at 12:44 comment added GawdePrasad Thanks for the link, I was not aware that Microsoft has recommended to not use Hungarian notation.
Sep 23, 2015 at 11:27 comment added Froome 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.
Sep 23, 2015 at 11:14 comment added GawdePrasad 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.
Sep 23, 2015 at 11:13 history edited Froome CC BY-SA 3.0
added 48 characters in body
Sep 23, 2015 at 11:05 history answered Froome CC BY-SA 3.0