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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:11:07+00:00 2026-05-22T01:11:07+00:00

Not found it in StyleCop Help Manual, on SO and Google so here it

  • 0

Not found it in StyleCop Help Manual, on SO and Google so here it is 😉

During StyleCop use I have a warning:

SA1121 – UseBuiltInTypeAlias –
Readability Rules

The code uses one of the basic C#
types, but does not use the built-in
alias for the type.

Rather than using the type name or the
fully-qualified type name, the
built-in aliases for these types
should always be used: bool, byte,
char, decimal, double, short, int,
long, object, sbyte, float, string,
ushort, uint, ulong.

so String.Empty is wrong (depend on above rules) and string.Empty is good.

Why using built-in aliases is better? Can String. Int32, Int64 (etc.) complicate something in the code on special scenarios?

  • 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-22T01:11:08+00:00Added an answer on May 22, 2026 at 1:11 am

    Just to clarify: not everyone agrees with the authors of StyleCop. Win32 and .NET guru Jeffrey Richter writes in his excellent book CLR via C#:

    The C# language specification states, “As a matter of style, use of the keyword is favored over
    use of the complete system type name.” I disagree with the language specification; I prefer
    to use the FCL type names and completely avoid the primitive type names. In fact, I wish that
    compilers didn’t even offer the primitive type names and forced developers to use the FCL
    type names instead. Here are my reasons:

    • I’ve seen a number of developers confused, not knowing whether to use string
      or String in their code. Because in C# string (a keyword) maps exactly to
      System.String (an FCL type), there is no difference and either can be used. Similarly,
      I’ve heard some developers say that int represents a 32-bit integer when the application
      is running on a 32-bit OS and that it represents a 64-bit integer when the application
      is running on a 64-bit OS. This statement is absolutely false: in C#, an int always maps
      to System.Int32, and therefore it represents a 32-bit integer regardless of the OS the
      code is running on. If programmers would use Int32 in their code, then this potential
      confusion is also eliminated.

    • In C#, long maps to System.Int64, but in a different programming language, long
      could map to an Int16 or Int32. In fact, C++/CLI does treat long as an Int32.
      Someone reading source code in one language could easily misinterpret the code’s
      intention if he or she were used to programming in a different programming language.
      In fact, most languages won’t even treat long as a keyword and won’t compile code
      that uses it.

    • The FCL has many methods that have type names as part of their method names. For
      example, the BinaryReader type offers methods such as ReadBoolean, ReadInt32,
      ReadSingle, and so on, and the System.Convert type offers methods such as
      ToBoolean, ToInt32, ToSingle, and so on. Although it’s legal to write the following
      code, the line with float feels very unnatural to me, and it’s not obvious that the line is
      correct:

      BinaryReader br = new BinaryReader(...);
      float val = br.ReadSingle(); // OK, but feels unnatural
      Single val = br.ReadSingle(); // OK and feels good
      
    • Many programmers that use C# exclusively tend to forget that other programming
      languages can be used against the CLR, and because of this, C#-isms creep into the
      class library code. For example, Microsoft’s FCL is almost exclusively written in C# and
      developers on the FCL team have now introduced methods into the library such as
      Array’s GetLongLength, which returns an Int64 value that is a long in C# but not
      in other languages (like C++/CLI). Another example is System.Linq.Enumerable’s
      LongCount method.

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

Sidebar

Related Questions

I have scanned 'the Google' and have not found the definitive answer on whether
Here is a hum-dinger of a problem that I have not found an answer
I have not found what is the use of jquery function data() . Can
I have searched on here and have not found exactly what I am looking
unfortunately I have not found anything yet, maybe anyone could help me or give
com/jniwrapper/win32/ie/WebBrowser class not found. From where can I download jniWrapper library. I have downloaded
We have encountered a very strange class not found problem in our web app
i have not found a suitable answer can anyone plese tell me the way
I have not found a clear and obvious suggestion to emulate the browser's 'Back'
I have done a little googling but not found too much info on the

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.