<?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"
	>
<channel>
	<title>Comments on: C# Gripe: enum base types</title>
	<atom:link href="http://www.stonetable.org/2005/06/24/test/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stonetable.org/2005/06/24/test/</link>
	<description>Don’t think different — be different.</description>
	<pubDate>Fri, 21 Nov 2008 05:13:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Nikki</title>
		<link>http://www.stonetable.org/2005/06/24/test/#comment-551</link>
		<dc:creator>Nikki</dc:creator>
		<pubDate>Mon, 18 Jul 2005 18:17:07 +0000</pubDate>
		<guid isPermaLink="false">http://stonetable.org/2005/06/24/test/#comment-551</guid>
		<description>C# isn't a valid value for the attribute "lang".</description>
		<content:encoded><![CDATA[<p>C# isn&#8217;t a valid value for the attribute &#8220;lang&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DrPizza</title>
		<link>http://www.stonetable.org/2005/06/24/test/#comment-550</link>
		<dc:creator>DrPizza</dc:creator>
		<pubDate>Fri, 24 Jun 2005 22:49:04 +0000</pubDate>
		<guid isPermaLink="false">http://stonetable.org/2005/06/24/test/#comment-550</guid>
		<description>&#34;even though the type of the enum is int&#34;No, it isn't.  The type of an enum is whatever the type you've specified; in this case the type is &#34;Fields&#34;.  That it has a *representation* that uses integers is for the most part an irrelevant implementation detail.This is done much better in Java 5, as it happens; Java 5 finally has proper enumerated values, and there they don't even pretend to have any representation.  But they're also fully-fledged classes, so you can have members and methods and the like.  They're powerful and really rather good.C# unfortuanately goes with C-style enums, albeit with the &#34;bonus&#34; feature that you can specify some aspects of the representation; specifically the width of the integer and the integral value.  This is a mistake.  C# enums should function as Java enums.</description>
		<content:encoded><![CDATA[<p>&quot;even though the type of the enum is int&quot;No, it isn&#8217;t.  The type of an enum is whatever the type you&#8217;ve specified; in this case the type is &quot;Fields&quot;.  That it has a *representation* that uses integers is for the most part an irrelevant implementation detail.This is done much better in Java 5, as it happens; Java 5 finally has proper enumerated values, and there they don&#8217;t even pretend to have any representation.  But they&#8217;re also fully-fledged classes, so you can have members and methods and the like.  They&#8217;re powerful and really rather good.C# unfortuanately goes with C-style enums, albeit with the &quot;bonus&quot; feature that you can specify some aspects of the representation; specifically the width of the integer and the integral value.  This is a mistake.  C# enums should function as Java enums.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anders Widebrant</title>
		<link>http://www.stonetable.org/2005/06/24/test/#comment-549</link>
		<dc:creator>Anders Widebrant</dc:creator>
		<pubDate>Fri, 24 Jun 2005 22:35:46 +0000</pubDate>
		<guid isPermaLink="false">http://stonetable.org/2005/06/24/test/#comment-549</guid>
		<description>I think it's somewhat fair to require the cast, if one accepts the philosophy that the purpose of enums is to create a distinct type with a number of named values. According to this philosophy, it would be more legitimate to complain that AddAttribute uses a raw int argument rather than defining a proper descriptive enum type. The solution for naming integer arguments would then look something like this:

public class Fields
{
  static const int Keyword = 0;
  static const int enum2 = 1;
  // ...
}</description>
		<content:encoded><![CDATA[<p>I think it&#8217;s somewhat fair to require the cast, if one accepts the philosophy that the purpose of enums is to create a distinct type with a number of named values. According to this philosophy, it would be more legitimate to complain that AddAttribute uses a raw int argument rather than defining a proper descriptive enum type. The solution for naming integer arguments would then look something like this:</p>
<p>public class Fields<br />
{<br />
  static const int Keyword = 0;<br />
  static const int enum2 = 1;<br />
  // &#8230;<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
