What is significance of upper and lower case intellisence words

When using intillisence, if I type in a word like string, I see that I can type it in lower case and it comes up blue, or in proper case, and it comes in in light blue. What is the significance Are they both words that are acceptable to declare a string variable Why do they have different colors



Answer this question

What is significance of upper and lower case intellisence words

  • watch is

    Thank you for responding.

    I understand what you are saying but it doesn't really answer my question. I am wondering which to use in C#, Proper case String (light blue) or lower case string (dark blue), or does it make any difference. If it doesn't make any difference, why the different colors


  • Salanitro

    Whenever possible use the darker blue keywords (generally lower case one) that are defined as part of the language instead of those that are defined as part of the CLR.

    The reason for this is primarily two fold. First up, by using the language specific ones it makes your code more portable (in theory) so that if at a later date the CLR implementation changes (ie Int32 no longer exists (unlikely I know)), int would map to something else and if you used the language specific types then you would be relatively unaffected.

    Second... tradition, since C# is based on C/C++ where lower case types were used, people traditionally use the same types whenever possible in C# today.

    In the end though it is completely up to you as functionally there is no difference, using one over the other is not going to improve or harm the performance of your code in any way.



  • AlEvan

    Brendan Grant wrote:

    Second... tradition, since C# is based on C/C++ where lower case types were used, people traditionally use the same types whenever possible in C# today.

    Although they don't always have the same representation; char and long come to mind.



  • Ajit_2005

    So, to summarize, language specific words are in dark blue. It makes since to use a language specific dark blue word if this is indigenous to the language I am using.

    Thank you


  • KYChen

    Rather than have different languages have their own custom types that no others can access, the CLR provides common types such as String, Int32, Int16, Boolean and so on (all contained within the System namespace). It is up to the makers of each language to tailor their design so as to use the types provided by the CLR wherever possible, so in C# whenever you type string (lower case), it is being used behind the scenes as a CLR type String.

    The same goes for most of the blue keywords, they are translated into CLR types where int becomes Int32, short becomes Int16 and bool becomes Boolean. This mapping goes on in the background and is something you can for the most part not worry about.

    It is good practice however to use the language specific types whenever possible, so when needing an unsigned 32 bit integer in C#, you should probably use uint instead of UInt32.



  • What is significance of upper and lower case intellisence words