<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-20777823.post993677549285065775..comments</id><updated>2007-02-26T09:41:51.033Z</updated><title type='text'>Comments on Blogging is... contagious: Defining values in enums</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kntajus.blogspot.com/feeds/993677549285065775/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20777823/993677549285065775/comments/default'/><link rel='alternate' type='text/html' href='http://kntajus.blogspot.com/2007/02/defining-values-in-enums.html'/><author><name>Stephen Salt</name><uri>http://www.blogger.com/profile/12125939334750090987</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-20777823.post-8988550971338242476</id><published>2007-02-26T09:41:00.000Z</published><updated>2007-02-26T09:41:00.000Z</updated><title type='text'>@infinity88:I agree completely that it shouldn't b...</title><content type='html'>@infinity88:&lt;BR/&gt;I agree completely that it shouldn't be &lt;I&gt;named&lt;/I&gt; Zero, as that is meaningless - hence my choice of Unknown. The second link that rajbk posted for Krzysztof's blog contains the guideline I was attempting to follow:&lt;BR/&gt;&lt;BR/&gt;* Do provide a value of zero on your non-flags enum&lt;BR/&gt;&lt;BR/&gt;If None is not appropriate for the enum, then assign the zero-value to the element which should be used as the default value for the enum.&lt;BR/&gt;&lt;BR/&gt;If the enum can logically support the concept of ‘None’, then add a None value to the enum, and give it the zero value</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20777823/993677549285065775/comments/default/8988550971338242476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20777823/993677549285065775/comments/default/8988550971338242476'/><link rel='alternate' type='text/html' href='http://kntajus.blogspot.com/2007/02/defining-values-in-enums.html?showComment=1172482860000#c8988550971338242476' title=''/><author><name>Stephen Salt</name><uri>http://www.blogger.com/profile/12125939334750090987</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16789024444243043082'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://kntajus.blogspot.com/2007/02/defining-values-in-enums.html' ref='tag:blogger.com,1999:blog-20777823.post-993677549285065775' source='http://www.blogger.com/feeds/20777823/posts/default/993677549285065775' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-20777823.post-6706939251716850350</id><published>2007-02-23T17:28:00.000Z</published><updated>2007-02-23T17:28:00.000Z</updated><title type='text'>I thought it was part of the Enum Design Guideline...</title><content type='html'>I thought it was part of the Enum Design Guideline but I don't see it at the moment.&lt;BR/&gt;&lt;BR/&gt;If you specify a value for any member of the enum, you should specify the value for all the enums.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20777823/993677549285065775/comments/default/6706939251716850350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20777823/993677549285065775/comments/default/6706939251716850350'/><link rel='alternate' type='text/html' href='http://kntajus.blogspot.com/2007/02/defining-values-in-enums.html?showComment=1172251680000#c6706939251716850350' title=''/><author><name>AndrewSeven</name><uri>http://www.blogger.com/profile/01162994917943149327</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://kntajus.blogspot.com/2007/02/defining-values-in-enums.html' ref='tag:blogger.com,1999:blog-20777823.post-993677549285065775' source='http://www.blogger.com/feeds/20777823/posts/default/993677549285065775' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-20777823.post-3942618422933222456</id><published>2007-02-23T17:13:00.000Z</published><updated>2007-02-23T17:13:00.000Z</updated><title type='text'>The fact you should have a default 'zero' value do...</title><content type='html'>The fact you should have a default 'zero' value doesn't mean you need one explicitly. One of your 3 values can be the default. I think it would be wierd from calling code for example if they say "Decision." and they see this mysterious Zero value in the list... what is that supposed to mean?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20777823/993677549285065775/comments/default/3942618422933222456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20777823/993677549285065775/comments/default/3942618422933222456'/><link rel='alternate' type='text/html' href='http://kntajus.blogspot.com/2007/02/defining-values-in-enums.html?showComment=1172250780000#c3942618422933222456' title=''/><author><name>Infinity88</name><uri>http://www.blogger.com/profile/03498086707006893731</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://kntajus.blogspot.com/2007/02/defining-values-in-enums.html' ref='tag:blogger.com,1999:blog-20777823.post-993677549285065775' source='http://www.blogger.com/feeds/20777823/posts/default/993677549285065775' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-20777823.post-6231246421785624802</id><published>2007-02-23T16:53:00.000Z</published><updated>2007-02-23T16:53:00.000Z</updated><title type='text'>This is the best guideline to followhttp://blogs.m...</title><content type='html'>This is the best guideline to follow&lt;BR/&gt;&lt;BR/&gt;http://blogs.msdn.com/kcwalina/archive/2004/05/18/134208.aspx</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20777823/993677549285065775/comments/default/6231246421785624802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20777823/993677549285065775/comments/default/6231246421785624802'/><link rel='alternate' type='text/html' href='http://kntajus.blogspot.com/2007/02/defining-values-in-enums.html?showComment=1172249580000#c6231246421785624802' title=''/><author><name>rajbk</name><uri>http://www.blogger.com/profile/17859871857510640398</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://kntajus.blogspot.com/2007/02/defining-values-in-enums.html' ref='tag:blogger.com,1999:blog-20777823.post-993677549285065775' source='http://www.blogger.com/feeds/20777823/posts/default/993677549285065775' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-20777823.post-9094095419161423809</id><published>2007-02-23T16:48:00.000Z</published><updated>2007-02-23T16:48:00.000Z</updated><title type='text'>http://msdn2.microsoft.com/en-us/library/aa664599(...</title><content type='html'>http://msdn2.microsoft.com/en-us/library/aa664599(VS.71).aspx&lt;BR/&gt;&lt;BR/&gt;If the declaration of the enum member has a constant-expression initializer, the value of that constant expression, implicitly converted to the underlying type of the enum, is the associated value of the enum member.&lt;BR/&gt;If the declaration of the enum member has no initializer, its associated value is set implicitly, as follows:&lt;BR/&gt;&lt;BR/&gt;    * If the enum member is the first enum member declared in the enum type, its associated value is zero.&lt;BR/&gt;    * Otherwise, the associated value of the enum member is obtained by increasing the associated value of the textually preceding enum member by one. This increased value must be within the range of values that can be represented by the underlying type; otherwise, a compile-time error occurs.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20777823/993677549285065775/comments/default/9094095419161423809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20777823/993677549285065775/comments/default/9094095419161423809'/><link rel='alternate' type='text/html' href='http://kntajus.blogspot.com/2007/02/defining-values-in-enums.html?showComment=1172249280000#c9094095419161423809' title=''/><author><name>rajbk</name><uri>http://www.blogger.com/profile/17859871857510640398</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://kntajus.blogspot.com/2007/02/defining-values-in-enums.html' ref='tag:blogger.com,1999:blog-20777823.post-993677549285065775' source='http://www.blogger.com/feeds/20777823/posts/default/993677549285065775' type='text/html'/></entry></feed>