<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: In C#, When to use String verses string</title>
	<atom:link href="http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/feed/" rel="self" type="application/rss+xml" />
	<link>http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/</link>
	<description>Microsoft Focussed, JavaScript (ExtJS, SenchaTouch &#38; Windows 8 Metro)</description>
	<lastBuildDate>Wed, 08 Feb 2012 21:38:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Troy Alford</title>
		<link>http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/comment-page-1/#comment-31381</link>
		<dc:creator>Troy Alford</dc:creator>
		<pubDate>Fri, 04 Nov 2011 16:12:35 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/#comment-31381</guid>
		<description>@Ryan:

I think that&#039;s the entire point of the article, actually. That is what the syntax highlighting would seem to indicate - but in this case, just like with bool/Boolean, int/Int32 and so on, this is actually not true.

These are actual aliases for one another - and they are exactly equivalent in every way other than the color they get highlighted on the screen.

I think the bone of contention is whether or not that is &quot;good&quot; - and what constitutes &quot;best practice&quot; with regards to readability and such. At the end of the day, though - if you use them interchangeably, there is absolutely no performance difference whatsoever - because both string and String compile to System.String - and are exactly identical.

This is far more an esoteric debate revolving around preference. :P</description>
		<content:encoded><![CDATA[<p>@Ryan:</p>
<p>I think that&#8217;s the entire point of the article, actually. That is what the syntax highlighting would seem to indicate &#8211; but in this case, just like with bool/Boolean, int/Int32 and so on, this is actually not true.</p>
<p>These are actual aliases for one another &#8211; and they are exactly equivalent in every way other than the color they get highlighted on the screen.</p>
<p>I think the bone of contention is whether or not that is &#8220;good&#8221; &#8211; and what constitutes &#8220;best practice&#8221; with regards to readability and such. At the end of the day, though &#8211; if you use them interchangeably, there is absolutely no performance difference whatsoever &#8211; because both string and String compile to System.String &#8211; and are exactly identical.</p>
<p>This is far more an esoteric debate revolving around preference. <img src='http://peterkellner.net/wp/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/comment-page-1/#comment-30932</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Fri, 30 Sep 2011 06:02:12 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/#comment-30932</guid>
		<description>string is a primative type which is exactly how it is in other languages... Just a string.  String however is an object.  String is used to create an Object that contains this string.  String will take up more membery but is called faster.  If something is created then destroyed, for instance a private string _var; then that is correct.  However if it will be referenced over and over then you should use String.</description>
		<content:encoded><![CDATA[<p>string is a primative type which is exactly how it is in other languages&#8230; Just a string.  String however is an object.  String is used to create an Object that contains this string.  String will take up more membery but is called faster.  If something is created then destroyed, for instance a private string _var; then that is correct.  However if it will be referenced over and over then you should use String.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/comment-page-1/#comment-30361</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Thu, 11 Aug 2011 10:31:14 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/#comment-30361</guid>
		<description>To answer this, we need to understand why the alias &#039;string&#039; exists in the first place?  Why not just use &#039;System.String&#039; everywhere?

My belief is that the alias exists to make code more readable, and has as much to do with syntax highlighting in VS than anything.  Although a reference type, System.String is used like a simple value type in the overwhelming majority of cases.  The exception to this is when accessing static members of the class like String.Empty.

Therefore, I would use &#039;string&#039; when instantiating a new instance, and declaring variables etc.  But when I need to put string.Something, it&#039;s time to switch to the capital S - String, as we don&#039;t often see valuetype.Something, so in my view string.Empty looks odd, so IMHO, best use would be...

string foo = String.Empty;

P.S. @Josh ... spoken like a true VB programmer ;)</description>
		<content:encoded><![CDATA[<p>To answer this, we need to understand why the alias &#8217;string&#8217; exists in the first place?  Why not just use &#8216;System.String&#8217; everywhere?</p>
<p>My belief is that the alias exists to make code more readable, and has as much to do with syntax highlighting in VS than anything.  Although a reference type, System.String is used like a simple value type in the overwhelming majority of cases.  The exception to this is when accessing static members of the class like String.Empty.</p>
<p>Therefore, I would use &#8217;string&#8217; when instantiating a new instance, and declaring variables etc.  But when I need to put string.Something, it&#8217;s time to switch to the capital S &#8211; String, as we don&#8217;t often see valuetype.Something, so in my view string.Empty looks odd, so IMHO, best use would be&#8230;</p>
<p>string foo = String.Empty;</p>
<p>P.S. @Josh &#8230; spoken like a true VB programmer <img src='http://peterkellner.net/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: azza</title>
		<link>http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/comment-page-1/#comment-29773</link>
		<dc:creator>azza</dc:creator>
		<pubDate>Sun, 17 Apr 2011 23:16:29 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/#comment-29773</guid>
		<description>i know this post is old but ~ @Josh, lol at the suggestion that microsoft should throw out their flagship product because you dont like case sensitivity...  vb is for nubs...</description>
		<content:encoded><![CDATA[<p>i know this post is old but ~ @Josh, lol at the suggestion that microsoft should throw out their flagship product because you dont like case sensitivity&#8230;  vb is for nubs&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: strainedeye</title>
		<link>http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/comment-page-1/#comment-25400</link>
		<dc:creator>strainedeye</dc:creator>
		<pubDate>Wed, 16 Sep 2009 00:40:07 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/#comment-25400</guid>
		<description>obsolesce i mean :)</description>
		<content:encoded><![CDATA[<p>obsolesce i mean <img src='http://peterkellner.net/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: strainedeye</title>
		<link>http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/comment-page-1/#comment-25399</link>
		<dc:creator>strainedeye</dc:creator>
		<pubDate>Wed, 16 Sep 2009 00:38:06 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/#comment-25399</guid>
		<description>@Mr_Not_VB

that&#039;s why he said vb should be deprecated or put to obsolence</description>
		<content:encoded><![CDATA[<p>@Mr_Not_VB</p>
<p>that&#8217;s why he said vb should be deprecated or put to obsolence</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mr_Not_VB</title>
		<link>http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/comment-page-1/#comment-25134</link>
		<dc:creator>Mr_Not_VB</dc:creator>
		<pubDate>Fri, 17 Jul 2009 23:48:27 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/#comment-25134</guid>
		<description>@Josh Stodola

Microsoft created VB for guys like you who still need training wheels.</description>
		<content:encoded><![CDATA[<p>@Josh Stodola</p>
<p>Microsoft created VB for guys like you who still need training wheels.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wolf wOLF</title>
		<link>http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/comment-page-1/#comment-19963</link>
		<dc:creator>Wolf wOLF</dc:creator>
		<pubDate>Wed, 11 Mar 2009 14:27:29 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/#comment-19963</guid>
		<description>No that doesn&#039;t make sense Rusty. 

Use like so:

String nameOfSomething = String.Empty;

i mean String is a class and who starts a class name in lowercase? Right knowone :P</description>
		<content:encoded><![CDATA[<p>No that doesn&#8217;t make sense Rusty. </p>
<p>Use like so:</p>
<p>String nameOfSomething = String.Empty;</p>
<p>i mean String is a class and who starts a class name in lowercase? Right knowone <img src='http://peterkellner.net/wp/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/comment-page-1/#comment-1101</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Thu, 28 Aug 2008 16:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/#comment-1101</guid>
		<description>haha, nice answer, Rusty</description>
		<content:encoded><![CDATA[<p>haha, nice answer, Rusty</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rusty</title>
		<link>http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/comment-page-1/#comment-679</link>
		<dc:creator>Rusty</dc:creator>
		<pubDate>Sun, 06 Jan 2008 04:39:25 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/#comment-679</guid>
		<description>String.Empty or string.Empty? and why?
Use string.empty when you have a space after the = and String.Empty when you are starting on a new line.

Why?  Because people just need rules, apparently.</description>
		<content:encoded><![CDATA[<p>String.Empty or string.Empty? and why?<br />
Use string.empty when you have a space after the = and String.Empty when you are starting on a new line.</p>
<p>Why?  Because people just need rules, apparently.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naveen J</title>
		<link>http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/comment-page-1/#comment-678</link>
		<dc:creator>Naveen J</dc:creator>
		<pubDate>Wed, 02 Jan 2008 06:26:39 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/#comment-678</guid>
		<description>one doubt.
which is better to use?
String.Empty or string.Empty? and why?
Or are they both same since string is an alias of String?</description>
		<content:encoded><![CDATA[<p>one doubt.<br />
which is better to use?<br />
String.Empty or string.Empty? and why?<br />
Or are they both same since string is an alias of String?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Kellner</title>
		<link>http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/comment-page-1/#comment-677</link>
		<dc:creator>Peter Kellner</dc:creator>
		<pubDate>Mon, 31 Dec 2007 15:22:30 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/#comment-677</guid>
		<description>I&#039;m more thinking that things like S or s doesn&#039;t make a difference should be deprecated (like what&#039;s in this post).  I&#039;ve grown up using case sensative languages so I just always expect case will make a difference.  VB just confuses me.</description>
		<content:encoded><![CDATA[<p>I&#8217;m more thinking that things like S or s doesn&#8217;t make a difference should be deprecated (like what&#8217;s in this post).  I&#8217;ve grown up using case sensative languages so I just always expect case will make a difference.  VB just confuses me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Stodola</title>
		<link>http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/comment-page-1/#comment-676</link>
		<dc:creator>Josh Stodola</dc:creator>
		<pubDate>Mon, 31 Dec 2007 14:36:41 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2007/12/29/incsharpwhentousestringversesstring/#comment-676</guid>
		<description>In VB.NET, it will always capitalize the S for you, therefore you don&#039;t even have to think about it. Case-sensitive languages should be deprecated, IMO.</description>
		<content:encoded><![CDATA[<p>In VB.NET, it will always capitalize the S for you, therefore you don&#8217;t even have to think about it. Case-sensitive languages should be deprecated, IMO.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 5/46 queries in 0.064 seconds using disk

Served from: peterkellner.net @ 2012-02-10 06:18:52 -->
