Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8528739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:52:12+00:00 2026-06-11T08:52:12+00:00

According to the Best Practices section of the MSDN documentation for the System.Enum class:

  • 0

According to the Best Practices section of the MSDN documentation for the System.Enum class:

Do not define an enumeration value solely to mirror the state of the enumeration itself. For example, do not define an enumerated constant that merely marks the end of the enumeration. If you need to determine the last value of the enumeration, check for that value explicitly. In addition, you can perform a range check for the first and last enumerated constant if all values within the range are valid.

If I understand correctly, we shouldn’t declare an enum as follows.

public enum DrawOrder
{
    VeryBottom = 0,
    Bottom = 1,
    Middle = 2,
    Top = 3,
    Lowest = VeryBottom, //marks a position in the enum
    Highest = Top, //marks a position in the enum
}

Why is this considered bad practice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:52:13+00:00Added an answer on June 11, 2026 at 8:52 am

    Because those values may change over time. Suppose you set a property to (using your example) DrawOrder.Highest and store it in your database/document/other-data-sink.

    Time passes.

    Code Changes.

    Your DrawOrder enum has acquired a few more values and the value in your persisted data is now no longer equal to DrawOrder.Highest. It’s only equal to what ever DrawOrder.Highest mapped to at the time the data was persisted.

    Do you think that this situation might have the possibility of causing problems?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to Yahoo's Best Practices for Speeding Up your Site , the pros for
I'm trying to decide, according to Grails best practices and MVC patterns, when is
I'm having issues understanding how to configure TFS according to best practices as provided
according to this article: http://net.tutsplus.com/tutorials/other/top-20-mysql-best-practices/ using ORDER BY RAND() is a bad idea because:
According to What's the best way to communicate between view controllers? best practices for
According to Best way to remove from NSMutableArray while iterating? , we can't remove
According to Marcin Ciura's Optimal (best known) sequence of increments for shell sort algorithm
According MSDN, FxCop is an application that analyzes managed code assemblies (code that targets
In an attempt to follow best practices, we're trying to use the proper JavaScript/jQuery
I want to get some thoughts on best practices around making .NET app configuration

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.