<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Field names...</title><link>http://blogs.msdn.com/b/ericgu/archive/2005/03/09/390791.aspx</link><description>There are three common choices for field name conventions in C# code: No prefix ("string name;") Underscore ("string _name;") MFC-style ("string m_name;") I label the third MFC-style because that's where I first encountered it. In the past, I haven't</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title> Eric Gunnerson s C Compendium Field names | Hair Growth Products</title><link>http://blogs.msdn.com/b/ericgu/archive/2005/03/09/390791.aspx#9744737</link><pubDate>Sat, 13 Jun 2009 15:56:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9744737</guid><dc:creator> Eric Gunnerson s C Compendium Field names | Hair Growth Products</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://hairgrowthproducts.info/story.php?id=403"&gt;http://hairgrowthproducts.info/story.php?id=403&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9744737" width="1" height="1"&gt;</description></item><item><title> Eric Gunnerson s C Compendium Field names | Green Tea Fat Burner</title><link>http://blogs.msdn.com/b/ericgu/archive/2005/03/09/390791.aspx#9706779</link><pubDate>Mon, 08 Jun 2009 05:31:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9706779</guid><dc:creator> Eric Gunnerson s C Compendium Field names | Green Tea Fat Burner</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://greenteafatburner.info/story.php?id=4172"&gt;http://greenteafatburner.info/story.php?id=4172&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9706779" width="1" height="1"&gt;</description></item><item><title>re: Field names...</title><link>http://blogs.msdn.com/b/ericgu/archive/2005/03/09/390791.aspx#399905</link><pubDate>Mon, 21 Mar 2005 19:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:399905</guid><dc:creator>tina</dc:creator><description>&lt;a target="_new" href="http://dir.zuoce.com/Finance_and_Investment/"&gt;http://dir.zuoce.com/Finance_and_Investment/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Entertainment/"&gt;http://dir.zuoce.com/Entertainment/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Agriculture/"&gt;http://dir.zuoce.com/Agriculture/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Electronic_Commerce/"&gt;http://dir.zuoce.com/Electronic_Commerce/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Computers_and_Internet/"&gt;http://dir.zuoce.com/Computers_and_Internet/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Toys/"&gt;http://dir.zuoce.com/Toys/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/News_and_Media/"&gt;http://dir.zuoce.com/News_and_Media/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Telecommunications/"&gt;http://dir.zuoce.com/Telecommunications/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Arts_and_Crafts/"&gt;http://dir.zuoce.com/Arts_and_Crafts/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Trade/"&gt;http://dir.zuoce.com/Trade/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Apparel/"&gt;http://dir.zuoce.com/Apparel/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Manufacturing/"&gt;http://dir.zuoce.com/Manufacturing/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Conventions_and_Conferences/"&gt;http://dir.zuoce.com/Conventions_and_Conferences/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Food_and_beverages/"&gt;http://dir.zuoce.com/Food_and_beverages/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Jewelry/"&gt;http://dir.zuoce.com/Jewelry/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Government_Agents/"&gt;http://dir.zuoce.com/Government_Agents/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Travel/"&gt;http://dir.zuoce.com/Travel/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Packaging/"&gt;http://dir.zuoce.com/Packaging/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Corporate_Services/"&gt;http://dir.zuoce.com/Corporate_Services/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Industrial_Supplies/"&gt;http://dir.zuoce.com/Industrial_Supplies/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Education/"&gt;http://dir.zuoce.com/Education/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Transportation/"&gt;http://dir.zuoce.com/Transportation/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Chemicals_and_Allied_Products/"&gt;http://dir.zuoce.com/Chemicals_and_Allied_Products/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Employment_and_Work/"&gt;http://dir.zuoce.com/Employment_and_Work/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Business_Opportunities/"&gt;http://dir.zuoce.com/Business_Opportunities/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Architecture/"&gt;http://dir.zuoce.com/Architecture/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Beauty_and_Fitness/"&gt;http://dir.zuoce.com/Beauty_and_Fitness/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Companies/"&gt;http://dir.zuoce.com/Companies/&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://dir.zuoce.com/Gifts_and_Occasions/"&gt;http://dir.zuoce.com/Gifts_and_Occasions/&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=399905" width="1" height="1"&gt;</description></item><item><title>re: Field names...</title><link>http://blogs.msdn.com/b/ericgu/archive/2005/03/09/390791.aspx#397795</link><pubDate>Thu, 17 Mar 2005 16:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:397795</guid><dc:creator>Michael Cook</dc:creator><description>#3 is too much, #1 is too little, #2 is just right :)&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=397795" width="1" height="1"&gt;</description></item><item><title>re: Field names...</title><link>http://blogs.msdn.com/b/ericgu/archive/2005/03/09/390791.aspx#396768</link><pubDate>Wed, 16 Mar 2005 15:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:396768</guid><dc:creator>duncan</dc:creator><description>Since I hate trying to type lots of _'s (shifted characters are bad m'kay) I prefix member variables with just the 'm':&lt;br&gt;&lt;br&gt;mMembershipList;&lt;br&gt;&lt;br&gt;otherwise no prefixes allowed.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=396768" width="1" height="1"&gt;</description></item><item><title>re: Field names...</title><link>http://blogs.msdn.com/b/ericgu/archive/2005/03/09/390791.aspx#395590</link><pubDate>Tue, 15 Mar 2005 02:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:395590</guid><dc:creator>Jason Cone</dc:creator><description>I seem to be in the minority, but I can't stand prefixes on variable names.  Spare me from ever working with Hungarian-notated code!  Put me in camp #1.&lt;br&gt;&lt;br&gt;If approach #1 was not an option for some reason, then appending an underscore seems like a reasonable (and less obtrusive) compromise.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=395590" width="1" height="1"&gt;</description></item><item><title>re: Field names...</title><link>http://blogs.msdn.com/b/ericgu/archive/2005/03/09/390791.aspx#394855</link><pubDate>Sun, 13 Mar 2005 15:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:394855</guid><dc:creator>Daniel Moth</dc:creator><description>'m'    for fields&lt;br&gt;'a'    for in parameters&lt;br&gt;'the'  for out paramters&lt;br&gt;'aThe' for inout params&lt;br&gt;''     for local vars (i.e. no prefix)&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=394855" width="1" height="1"&gt;</description></item><item><title>re: Field names...</title><link>http://blogs.msdn.com/b/ericgu/archive/2005/03/09/390791.aspx#392433</link><pubDate>Thu, 10 Mar 2005 19:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:392433</guid><dc:creator>Thomas Eyde</dc:creator><description>And&lt;br&gt;&lt;br&gt;string name_;&lt;br&gt;&lt;br&gt;even works in VB6:&lt;br&gt;&lt;br&gt;Dim name_ As String&lt;br&gt;&lt;br&gt;But that's a pure coinsidence, I guess?&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=392433" width="1" height="1"&gt;</description></item><item><title>re: Field names...</title><link>http://blogs.msdn.com/b/ericgu/archive/2005/03/09/390791.aspx#392212</link><pubDate>Thu, 10 Mar 2005 16:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:392212</guid><dc:creator>Scott Wisniewski</dc:creator><description>Personally, I like the naming convention advocated by Scott Meyers, and Andrei Alexandrescu:&lt;br&gt;&lt;br&gt;&lt;br&gt;string name_;&lt;br&gt;&lt;br&gt;&lt;br&gt;It doesn't feel like a compiler generated construct, the naming doesn't interfear with readability or asthetics, and its meaning is pretty clear.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=392212" width="1" height="1"&gt;</description></item><item><title>re: Field names...</title><link>http://blogs.msdn.com/b/ericgu/archive/2005/03/09/390791.aspx#392116</link><pubDate>Thu, 10 Mar 2005 14:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:392116</guid><dc:creator>it's all in the mix</dc:creator><description>It's not about using simplistic rules it's about the key goal:&lt;br&gt;&lt;br&gt;Can someone else* understand this quickly with little or no chance of errors.&lt;br&gt;&lt;br&gt;If you always try to keep variable scope extremly short then a lot of the prefixing usage becomes redundant (so it begins to hinder not help as you duplicate the information).&lt;br&gt;&lt;br&gt;Using this. in front of instance variables is also far more preferable since it make auto completion kick in. Unfortunately current visual studio behaviour is annoying when you have variable/property with identical names bar case - if I type in a lower case letter give me the lowercase one first dammit!!!**.&lt;br&gt;&lt;br&gt;One area lack of prefixes can cause confusion with is in constructors this prefixes should be mandatory (not at the compiler level I mean as a coding guideline)(I really should make that an FxCop rule at some point)&lt;br&gt;&lt;br&gt;I admit that static variables are an area that might benefit from an our. or class. (maybe static. would be non breaking).&lt;br&gt;* you in 6 months time counts as someone else ;&amp;#172;)&lt;br&gt;&lt;br&gt;** Sorry but if you could feed that back to the VS developers that would be good&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=392116" width="1" height="1"&gt;</description></item></channel></rss>