Anybody got any information/opinions on variable naming in C#?
Do we go Hungarian Notation or what?
Is there any standard yet, or are people just going their own way?
If there's a standard, then a link to a list would be appreciated.
Printable View
Anybody got any information/opinions on variable naming in C#?
Do we go Hungarian Notation or what?
Is there any standard yet, or are people just going their own way?
If there's a standard, then a link to a list would be appreciated.
This article may help you
http://www.c-sharpcorner.com/effecti...linesInNET.asp
Well.... yes. Interesting article, but it raises the same question that I'm raising. At least I can now see where the conflicting information comes from. Seems Microsoft changed their suggested standard in mid-release.
At least Hungarian lets you know the type of variable from its name. I guess that's not essential if the complier throws an error to warn you if you have the wrong type, but our VB brothers will have to remember to turn on Option Strict, unless they will tolerate type conversions.
Is type-conversion a bad thing? I know some purists consider it sloppy programming (yes, I'm one) - but can anybody think of a situation where it could lead to a real problem? Passing the wrong data type to an API maybe - but that's easily checked.