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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…