In c# if I use decimal (lower case ‘d’), the IDE shows it in dark blue (like int). If I use Decimal (upper case ‘d’), the IDE shows it in teal (like a class name). In both cases the tooltip is struct System.Decimal.
Is there any difference? Is one “preferred”?
Nope; identical.
decimalis defined as an alias toSystem.Decimal, and is generally preferred, except in public method names, where you should use the proper name (ReadDecimal, etc) – because your callers might not be C#. This is more noticeable inintvsReadInt32, etc.There certainly isn’t the Java-style boxing difference.
(of course, if you do something like declare a more-namespace-local
Decimalthat does something completely different, then there are differences, but that would be silly).