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 819143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:15:41+00:00 2026-05-15T02:15:41+00:00

According to the guidance published in New Recommendations for Using Strings in Microsoft .NET

  • 0

According to the guidance published in New Recommendations for Using Strings in Microsoft .NET 2.0, the data in a string may exhibit one of the following types of behavior:

  1. A non-linguistic identifier, where bytes match exactly.
  2. A non-linguistic identifier, where case is irrelevant, especially a piece of data stored in most Microsoft Windows system services.
  3. Culturally-agnostic data, which still is linguistically relevant.
  4. Data that requires local linguistic customs.

Given that, I’d like to know the best way to communicate which behavior is expected of a string parameter in a public API. I wasn’t able to find an answer in the Framework Design Guidelines.

Consider the following methods:

   f(string this_is_a_linguistic_string)
   g(string this_is_a_symbolic_identifier_so_use_ordinal_compares)

Is variable naming and XML documentation the best I can do? Could I use attributes in some way to mark the requirements of the string?

Now consider the following case:

   h(Dictionary<string, object> dictionary)

Note that the dictionary instance is created by the caller. How do I communicate that the callee expects the IEqualityComparer<string> object held by the dictionary to perform, for example, a case-insensitive ordinal comparison?

  • 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-15T02:15:42+00:00Added an answer on May 15, 2026 at 2:15 am

    You could always use a modified Hungarian convention (and I mean the Joel-approved kind):

    • Prefix cs for case-sensitive (non-linguistic)
    • Prefix ci for case-insensitive (non-linguistic)
    • Prefix cil for culture-invariant linguistic
    • Prefix csl for culture-specific linguistic or culture-sensitive linguistic

    The “i” and “s” have consistent implications here, even though they can mean two different things depending on the context, which is a helpful attribute. “i” means “don’t care” (about case/culture) and “s” means “do care”.

    Of course, as a disclaimer, I never do this, because for the vast majority of strings I deal with, the distinction between these types of strings is blurry at best. But if they have semantic meaning to you, this would be a reasonable alternative to relying on XML docs. Especially when you’re using them as arguments to private methods, which most people don’t write XML docs for.

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

Sidebar

Related Questions

According to what I have found so far, I can use the following code:
According to the .NET Framework General Reference: Error Raising and Handling Guidelines exceptions should
I am using a wcf basichttp adapter in biztalk using ESB guidance 1.0 i
I'm using MSBuild Community Tasks to automatically update my assembly version numbers according to
According to this discussion , the iphone agreement says that it doesn't allow loading
According to the manual , git dcommit will create a revision in SVN for
According to the documentation, they're pretty much interchangeable. Is there a stylistic reason to
According to MSDN form.RightToLeftLayout = True; form.RightToLeft = ifWeWantRTL() ? RightToLeft.True : RightToLeft.False; is
According to select name from system_privilege_map System has been granted: SELECT ANY TABLE ...and
According to the answers to this question, I cannot embed a file version in

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.