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

  • SEARCH
  • Home
  • 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 6719939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:09:08+00:00 2026-05-26T09:09:08+00:00

We are trying to use the IDesign C# Coding standard . Unfortunately, I found

  • 0

We are trying to use the IDesign C# Coding standard. Unfortunately, I found no comprehensive document to explain all the rules that it gives, and also his book does not always help.

Here are the open questions that remain for me (from chapter 2, Coding Practices):

  1. No. 26: Avoid providing explicit values for enums unless they are integer powers of 2
  2. No. 34: Always explicitly initialize an array of reference types using a for loop
  3. No. 50: Avoid events as interface members
  4. No. 52: Expose interfaces on class hierarchies
  5. No. 73: Do not define method-specific constraints in interfaces
  6. No. 74: Do not define constraints in delegates

Here’s what I think about those:

  1. I thought that providing explicit values would be especially useful when adding new enum members at a later point in time. If these members are added between other already existing members, I would provide explicit values to make sure the integer representation of existing members does not change.
  2. No idea why I would want to do this. I’d say this totally depends on the logic of my program.
  3. I see that there is alternative option of providing “Sink interfaces” (simply providing already all “OnXxxHappened” methods), but what is the reason to prefer one over the other?
  4. Unsure what he means here: Could this mean “When implementing an interface explicitly in a non-sealed class, consider providing the implementation in a protected virtual method that can be overridden”? (see Programming .NET Components 2nd Edition, end of chapter “Interfaces and Class Hierarchies”).
  5. I suppose this is about providing a “where” clause when using generics, but why is this bad on an interface?
  6. I suppose this is about providing a “where” clause when using generics, but why is this bad on a delegate?
  • 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-05-26T09:09:09+00:00Added an answer on May 26, 2026 at 9:09 am

    No. 26: Power of two means you want to use the enum as a bitmask (flags). Thats the only reason to specify enum values. For adding new members later on, you can still append them to the enum definition without changing existing values. No reason to put them between existing members.

    No. 34: I think he wants to avoid the situation where you have an array wich contains (partially) uninitialized pointers (null references). As the consumer of an array its tempting
    not to check for null entries in a valid array variable.

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

Sidebar

Related Questions

I am trying use javascript regular expressions to do some matching and I found
I have been trying use the edit_post_link() function to contain an image. All of
I have a regex that I'm trying use to validate against strings. Trying to
I have a 3rd party DLL that I am trying to use in a
I am trying use the jQuery table sorter plugin for a table that is
I am trying use the mysql connector in c++ in ubuntu. It appears that
I was trying use a set of filter functions to run the appropriate routine,
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I am trying use a Java Uploader in a ROR app (for its ease

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.