A Matter of Style: Aliases or Not?

As stated earlier, the C# reserved words for built-in types are simply aliases for the corresponding underlying BCL types. There’s no semantic difference whatsoever, so you can use either one.

Sometimes people start long-winded discussions on what’s the preferred style. I deliberately don’t participate in such discussion, but instead have one rule of thumb: consistency. Mixing aliases and raw BCL type names can yield only more confusion. But, objectively, both have their merits:

Image The BCL type names clearly indicate the range of numeric types in terms of bit width, but in a decimal-centric world that doesn’t tell ...

Get C# 5.0 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.